[R] Check for presence of object in group of objects
ccleland at optonline.net
Wed Jan 31 11:05:16 CET 2007
Christoph Heibl wrote:
> Dear List,
> must be simple, but i got stuck on this...
> I´ve been trying around for some time, but I could not find a
> straigthforward way to do this:
> How can one ask if a certain object is element of a certain group of
> objects, e.g stored in a vector?
> x <- c("a", "b", "c")
> # is there a simple function which returns:
> is "a" part of x?
> is "d" part of x?
x <- c("a", "b", "c")
"a" %in% x
"d" %in% x
> Thanks a lot
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Chuck Cleland, Ph.D.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894
More information about the R-help