[R] Find strings in a array

Douglas Bates bates at stat.wisc.edu
Sat Feb 8 21:06:02 CET 2003


Francisco do Nascimento Junior <fnj at cin.ufpe.br> writes:

> I need to know which strings of an array that are in another array.
> What a best solution?

%in%

> c("foo", "bar", "baz") %in% c("foo", "bar", "boz", "bonz")
[1]  TRUE  TRUE FALSE




More information about the R-help mailing list