[R] Checking if an element is part of a vector

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Oct 6 18:34:50 CEST 2004


?"%in%"
?is.element

On Wed, 6 Oct 2004, Dominik Bach wrote:

> I want to know if a given element <- ('c64') is part of a vector<-
> ('c64', 'amiga', 'atari').
> 
> Does a function exist for this which gives back a logical value?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list