Re: [R] row indexes from logical statment

2010-02-18 Thread Dennis Murphy
Hi: You might also want to consider the use of subset, as in subset(foo, name == "A")or subset(foo, name %in% c("A", "B")) HTH, Dennis On Thu, Feb 18, 2010 at 8:01 AM, stephen sefick wrote: > Is there any easy way to pull out the row indexes for a logical > matching statment? > >

Re: [R] row indexes from logical statment

2010-02-18 Thread Henrique Dallazuanna
If I understand your question, you can try this: which(foo$name %in% c("A", "B")) On Thu, Feb 18, 2010 at 2:01 PM, stephen sefick wrote: > Is there any easy way to pull out the row indexes for a logical > matching statment? > > #example code###

Re: [R] row indexes from logical statment

2010-02-18 Thread Ista Zahn
Hi Stephen, See below. On Thursday 18 February 2010 11:01:25 am stephen sefick wrote: > Is there any easy way to pull out the row indexes for a logical > matching statment? > > #example code# > foo <- data.frame(name=c(rep("A", 25), rep("B"

[R] row indexes from logical statment

2010-02-18 Thread stephen sefick
Is there any easy way to pull out the row indexes for a logical matching statment? #example code# foo <- data.frame(name=c(rep("A", 25), rep("B", 25), rep("C", 25), rep("A", 25)), stuff=rnorm(100), and=rnorm(100), things=rnorm(100)) #this is