Skip to content

Subset in, not in

3 messages · ramoss, Patrick Burns, David Winsemius

#
Hello,

I need to subset my dataframe into 2 parts;  in:   mm <- subset(agr1,
subset=lmpcrd %in% c(11697,149823,7654))
not in:  but where do I stick the " !" in the above?  I've tried every
position.

Thanks for your help.








--
View this message in context: http://r.789695.n4.nabble.com/Subset-in-not-in-tp4655178.html
Sent from the R help mailing list archive at Nabble.com.
#
Did you try:

mm <- subset(agr1, subset= !(lmpcrd %in% c(11697,149823,7654)))

(Actually the parentheses that I added are
not necessary, but they make me feel better.)

Pat
On 10/01/2013 19:54, ramoss wrote:

  
    
#
On Jan 10, 2013, at 12:04 PM, Patrick Burns wrote:

            
And it might be noted that this is part of the last example on the  
help page:

?'%in%'

-- 
David.