Skip to content

Testing whether a number belong to a set

5 messages · DHIMAN BHADRA, Seeliger.Curt at epamail.epa.gov, Eik Vettorazzi +2 more

#
Hi,
i think %in% will do exactly what you want
eg.

5 %in% 1:10


Am 02.02.2011 21:49, schrieb DHIMAN BHADRA:

  
    
#
Dhiman -
    You don't say what you want the result to be if the 
value is in both S1 and S2, but here's an example that
may give you some ideas:
[1] 1 1 1 2 2 2 0


 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu
On Wed, 2 Feb 2011, DHIMAN BHADRA wrote: