Please I don't know if there is an easy way to do this in R. I have 3 columns (child, father, mother) of about 5000 rows. I am trying to assign zero (0) to 25%, 50% and 75% in the column for father i.e. to assume that particular proportion is unknown (0). I want it to assign according to the number of rows for each father based on the total number of children for each father. In the data below, I would expect the script to substitute e.g. 25% of g, k, u and x with 0. Thanks
child father mother
1 g m1
2 g m2
3 g m1
4 g m2
5 g m1
6 g m2
7 k m1
8 k m2
9 k m1
10 k m2
11 u m1
12 u m2
13 u m1
14 u m2
15 u m1
16 x m2
17 x m1
18 x m2
19 x m1
20 x m2