[R] Subset in, not in

Patrick Burns pburns at pburns.seanet.com
Thu Jan 10 21:04:44 CET 2013


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:
> 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.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Patrick Burns
pburns at pburns.seanet.com
twitter: @portfolioprobe
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of 'Some hints for the R beginner'
and 'The R Inferno')




More information about the R-help mailing list