%like% {Tmisc} | R Documentation |
Returns a logical vector of elements of x matching the regex y.
x %like% pattern
x |
a vector (numeric, character, factor) |
pattern |
a vector (numeric, character, factor), matching the mode of x |
A logical vector with length equal to x
of things in x
that are like y
.
(Name <- c("Mary","George","Martha"))
Name %in% c("Mary")
Name %like% "^Mar"
Name %nin% c("George")
Name %nlike% "^Mar"