[R] Subset based on items in a list.

2008-10-13 Thread Kyle Ambert
R-help: I have a variable ("ID_list") containing about 1800 unique numbers, and a 143066x29 data frame. One of the columns ("ID") in my data frame contains a list of ids, many of which appear more than once. I'd like to find the subset of my data frame for which "ID" matches one of the numbers

Re: [R] Subset based on items in a list.

2008-10-13 Thread Erik Iverson
I don't know if I understand (small example with R command wouuld help), but, assuming your data.frame is called 'df' subset(df, ID %in% ID_list) Question, is ID_list a "list" or a vector, and are they really "numbers" or "factors"? Kyle. wrote: R-help: I have a variable ("ID_list") contai

[R] Subset based on items in a list.

2008-10-13 Thread Kyle.
R-help: I have a variable ("ID_list") containing about 1800 unique numbers, and a 143066x29 data frame. One of the columns ("ID") in my data frame contains a list of ids, many of which appear more than once. I'd like to find the subset of my data frame for which "ID" matches one of the numbers i