[R] How do I get the row indices?

2005-09-16 Thread Martin Lam
Hi, I was wondering if it's possible to get the row numbers from a filtering. Here's an example: # give me the rows with sepal.length == 6.2 iris[(iris[,1]==6.2),] # output Sepal.Length Sepal.Width Petal.Length Petal.Width Species 69 6.2 2.2 4.5 1.5

Re: [R] How do I get the row indices?

2005-09-16 Thread vincent
have a look at which() hih __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] How do I get the row indices?

2005-09-16 Thread Achim Zeileis
On Fri, 16 Sep 2005 10:34:57 -0700 (PDT) Martin Lam wrote: Hi, I was wondering if it's possible to get the row numbers from a filtering. Here's an example: # give me the rows with sepal.length == 6.2 iris[(iris[,1]==6.2),] # output Sepal.Length Sepal.Width Petal.Length

Re: [R] How do I get the row indices?

2005-09-16 Thread Gavin Simpson
On Fri, 2005-09-16 at 10:34 -0700, Martin Lam wrote: Hi, I was wondering if it's possible to get the row numbers from a filtering. Here's an example: # give me the rows with sepal.length == 6.2 iris[(iris[,1]==6.2),] # output Sepal.Length Sepal.Width Petal.Length Petal.Width

Re: [R] How do I get the row indices?

2005-09-16 Thread Berton Gunter
is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Lam Sent: Friday, September 16, 2005 10:35 AM To: R Subject: [R] How do I get the row indices? Hi, I was wondering if it's

Re: [R] How do I get the row indices?

2005-09-16 Thread Huntsinger, Reid
You can use which on your subscript vector. which(iris[,1] == 6.2) [1] 69 98 127 149 Reid Huntsinger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Lam Sent: Friday, September 16, 2005 1:35 PM To: R Subject: [R] How do I get the row indices

Re: [R] How do I get the row indices?

2005-09-16 Thread Marc Schwartz (via MN)
On Fri, 2005-09-16 at 10:34 -0700, Martin Lam wrote: Hi, I was wondering if it's possible to get the row numbers from a filtering. Here's an example: # give me the rows with sepal.length == 6.2 iris[(iris[,1]==6.2),] # output Sepal.Length Sepal.Width Petal.Length Petal.Width