[R] randomly subsample rows from subsets

aly alyabadia at gmail.com
Mon Mar 19 01:20:39 CET 2012


Hi,

I have a list of 1787 fish from 948 full-sib families and their lengths. My
table looks like this,

fish	fam	length
1	a	71.46
2	a	71.06
3	a	62.94
4	b	79.46
5	b	52.38
6	b	56.78
7	b	92.08
8	c	96.86
9	d	98.09
10	d	17.23
11	d	98.35
12	d	82.43
13	e	83.85
14	e	33.92
15	e	23.16
16	e	31.39
17	e	57.08
18	e	27.05
19	f	62.38
20	f	83.21
21	f	18.72
22	f	84.32
23	g	15.99
24	h	40.33
25	h	92.73
26	h	59.08
27	i	29.05

I want to randomly select 2 fish from each family that has 2 or more
individuals and exclude those families that have just one fish. How can I do
that? Thanks,



--
View this message in context: http://r.789695.n4.nabble.com/randomly-subsample-rows-from-subsets-tp4483477p4483477.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list