Skip to content
Prev 101172 / 398500 Next

searching for data.frame rows / processing of rows

I tought that aggregate was the way to go, but only for large dataframes it is 
faster.
0: Location   Time    X    Y
1:   1          0      1.6  9.3
2:   1          3      4.2  10.4
3:   1          6      2.7  16.3
4:   2          0      0.5  2.1
5:   2          3      NA   3.6
6:   2          3      5.0  0.06
7:   2          6      3.4  14.0
8:
Location Time   X     Y
1        1    0 1.6  9.30
2        2    0 0.5  2.10
3        1    3 4.2 10.40
4        2    3 5.0  1.83
5        1    6 2.7 16.30
6        2    6 3.4 14.00
[1] 0.008 0.000 0.008 0.000 0.000
[1] 0.005 0.000 0.005 0.000 0.000
+                  Time=sample(rep(1:50,each=10),2500,replace=TRUE),
+                  X=runif(2500),Y=runif(2500))
[1] 0.162 0.000 0.163 0.000 0.000
[1] 2.179 0.006 2.216 0.000 0.000


Kees
Gabor Grothendieck wrote:
http://www.R-project.org/posting-guide.html