You can try this also: is.element(2, x)
On Wed, Sep 23, 2009 at 12:37 PM, Dimitri Liakhovitski <ld7...@gmail.com> wrote: > Dear R'rs, > > is there a function that checks if a given vector contains a certain value. > E.g., x<-c(1,2,3,4). > How can I get a TRUE or FALSE for whether x contains a 2? > > -- > Dimitri Liakhovitski > Ninah.com > dimitri.liakhovit...@ninah.com > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.