[R] searching a vector

kjetil@acelerate.com kjetil at acelerate.com
Fri Apr 30 23:23:16 CEST 2004


On 30 Apr 2004 at 9:33, Arend P. van der Veen wrote:


> x <- c(1,2,4,6,8,10,12)
> 6 %in% x
[1] TRUE
> 


Kjetil Halvorsen

> Hi,
> 
> I have a integer vector x that contains a unique set of numbers: 
> 
> x <- c(1,2,4,6,8,10,12)
> 
> Is there a simple test I can use to determine if an integer such as 6
> is contained in x ?  
> 
> Thanks in advance for any help,
> Arend
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list