Skip to content
Back to formatted view

Raw Message

Message-ID: <416421D5.5030809@jhsph.edu>
Date: 2004-10-06T16:48:21Z
From: Roger D. Peng
Subject: Checking if an element is part of a vector
In-Reply-To: <200410061623.i96FiK7X018281@relay01.directbox.com>

Try

element %in% vector

or look at match()

-roger

Dominik Bach wrote:
> Hi!
> 
> 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?
> 
> thankx
> db
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>