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
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
2 matches
Mail list logo