[R] Find multiple elements in a vector

Michael Knudsen micknudsen at gmail.com
Wed Jul 22 21:58:46 CEST 2009


On Wed, Jul 22, 2009 at 9:37 PM, Chuck Cleland<ccleland at optonline.net> wrote:

>  How about this?
>
> which(x %in% c(2,3))

Thanks to you all! I had never thought about using %% in this context.

-- 
Michael Knudsen
micknudsen at gmail.com
http://lifeofknudsen.blogspot.com/




More information about the R-help mailing list