Skip to content

remove from column a group of elements I have in another vector

4 messages · Estefanía Gómez Galimberti, Sarah Goslee

#
You can probably do it with not in in R too:
for a data frame x where you want to remove rows where values in
column A are not in the vector y:

x[!(x$A %in% y), ]

If you'd provided a reproducible example, I could give code that works
in your particular circumstance.

Sarah

On Fri, Dec 21, 2012 at 12:43 PM, Estefan?a G?mez Galimberti
<tefagg at yahoo.com> wrote:
--
Sarah Goslee
http://www.functionaldiversity.org
#
Well, you could try it to see what happens...

First look at:
b$ansologin%in%quit
then
!(b$ansologin%in%quit)
and finally
b[!(b$ansologin%in%quit),]

You could also read the help
?"!"
?"%in%"

and the Intro to R manual that came with R when you installed it.

Sarah

On Sat, Dec 22, 2012 at 10:48 AM, Estefan?a G?mez Galimberti
<tefagg at yahoo.com> wrote:
--
Sarah Goslee
http://www.functionaldiversity.org