[R] subsampling table

Achim Eberhart a.eberhart at pgrad.unimelb.edu.au
Wed Nov 10 00:01:41 CET 2010


G'day R-helpers,

I want to subsample rows of a large table based on the value in its 
first column. Of all rows sharing the same value in the first column I 
want to RANDOMLY extract only one.
Thanks in advance,

Achim

example input

1	15	34
1	4	66
1	24	65
2	23	47
2	9	36
3	58	9
3	38	64
3	12	64
3	4	15
4	1	88
4	23	90

desired output

1	4	66
2	23	47
3	12	64
4	1	88



More information about the R-help mailing list