Re: [R] extracting rows from dataframe that match a vector

2008-02-05 Thread Gabor Csardi
You almost got it right. THe solution is df[df$ind %in% subgr,] See ?"%in%" G. On Tue, Feb 05, 2008 at 04:47:02PM +0100, Karin Lagesen wrote: > > Hi! > > I have a large dataframe that I want to extract a subset from. This > subset has a certain column value that matches elements in a vector I

[R] extracting rows from dataframe that match a vector

2008-02-05 Thread Karin Lagesen
Hi! I have a large dataframe that I want to extract a subset from. This subset has a certain column value that matches elements in a vector I have defined. So, my question is how do I get the rows that match one of the elements in the vector. Example: a = c(1:5) b = letters[1:10] df = data.fram