[R] element of

Marc Schwartz mschwartz at medanalytics.com
Wed May 7 18:24:02 CEST 2003


>-----Original Message-----
>From: r-help-bounces at stat.math.ethz.ch 
>[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
>alexander.schnee at tuebingen.mpg.de
>Sent: Wednesday, May 07, 2003 10:59 AM
>To: r-help at stat.math.ethz.ch
>Subject: [R] element of
>
>
>Dear all,
>
>is there any funktion in R which i can use to check if a 
>single value is element of a matrix or data.frame so that it 
>returns me logical values like TRUE/FALSE.
>
>Thanks in advance for your help!


See help("%in%") which will give you a TRUE/FALSE value.

You can also use which() to get the actual position of the element in
the data structure.  See help("which") for more information on that
function.

HTH,

Marc Schwartz




More information about the R-help mailing list