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