[R] printing a single row, but dont know which row to print

2009-11-16 Thread frenchcr
I have 20 columns of data, and in column 5 I have a value of 17600 but I dont know which row this value is in (i have over 300,000 rows). I'm trying to do 2 things: 1) I want to find out which row in column 5 has this number in it. 2) Then I want to print out that row with all the column

Re: [R] printing a single row, but dont know which row to print

2009-11-16 Thread baptiste auguie
Hi, Try this, set.seed(2) # reproducible d = matrix(sample(1:20,20), 4, 5) d d[ d[ ,2] == 18 , ] You may need to test with all.equal if your values are subject to rounding errors. HTH, baptiste 2009/11/16 frenchcr frenc...@btinternet.com: I have 20 columns of data, and in column 5 I have

Re: [R] printing a single row, but dont know which row to print

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 1:38 PM, baptiste auguie wrote: Hi, Try this, set.seed(2) # reproducible d = matrix(sample(1:20,20), 4, 5) d d[ d[ ,2] == 18 , ] You may need to test with all.equal if your values are subject to rounding errors. HTH, baptiste 2009/11/16 frenchcr