Estefanía Gómez Galimberti
2012-Dec-21 17:43 UTC
[R] remove from column a group of elements I have in another vector
Hi, I have a data frame and I would need to remove from one of the columns a group of elements I have in another vector. How can I do that? I know how to do it with criteria but i would need to do it in a more automatic way.... In SQL I would use where ---- not in ---- Thank you, Estefania [[alternative HTML version deleted]]
Sarah Goslee
2012-Dec-21 18:56 UTC
[R] remove from column a group of elements I have in another vector
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:> Hi, > > I have a data frame and I would need to remove from one of > the columns a group of elements I have in another vector. How can I do that? I know how to do it with criteria but i would need to do it in a more automatic way.... > In SQL I would use where > ---- not in ---- > > Thank you, > Estefania-- Sarah Goslee http://www.functionaldiversity.org