Re: [R] what is the "NOT IN" operator

2010-10-07 Thread Duncan Murdoch
i% letters[3:5] [1] TRUE TRUE FALSE From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Emily Deomano [edeom...@bses.com.au] Sent: 07 October 2010 09:17 To: r-help@r-project.org Subject: [R] what is the "NOT IN" operator Good day, I ne

Re: [R] what is the "NOT IN" operator

2010-10-07 Thread Ivan Calandra
] %ni% letters[3:5] [1] TRUE TRUE FALSE From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Emily Deomano [edeom...@bses.com.au] Sent: 07 October 2010 09:17 To: r-help@r-project.org Subject: [R] what is the "NOT IN" o

Re: [R] what is the "NOT IN" operator

2010-10-06 Thread Bill.Venables
g] On Behalf Of Emily Deomano [edeom...@bses.com.au] Sent: 07 October 2010 09:17 To: r-help@r-project.org Subject: [R] what is the "NOT IN" operator Good day, I need to subset a data by removing several rows. I know the %in% operator, i.e. sub <- mydata[group %in% c("A"

Re: [R] what is the "NOT IN" operator

2010-10-06 Thread David Winsemius
On Oct 6, 2010, at 9:03 PM, Christian Raschke wrote: Put the "!" in front of the whole expression, not just the %in% function. I.e. sub <- mydata[!(mydata$group %in% c("A", "B", "E", "G")),] You can also look at the match help page where %in% and its negation, %w/o% , are illustrated. --

Re: [R] what is the "NOT IN" operator

2010-10-06 Thread Christian Raschke
Put the "!" in front of the whole expression, not just the %in% function. I.e. sub <- mydata[!(mydata$group %in% c("A", "B", "E", "G")),] Christian On Thu, 2010-10-07 at 09:17 +1000, Emily Deomano wrote: > Good day, > I need to subset a data by removing several rows. I know the %in% operator,

[R] what is the "NOT IN" operator

2010-10-06 Thread Emily Deomano
Good day, I need to subset a data by removing several rows. I know the %in% operator, i.e. sub <- mydata[group %in% c("A","B","E","G"), ] What I need is the opposite, that is remove rows and/or columns. What is the operator for "NOT IN"? I tried (i)! %in% and (ii) ^%in% and both resulted in