I "think" I understand what you want.
This seems to work for the test data you supplied
below. At least it gives the expected answer.
df1 <- unique(test.data[,c(1,4)])
names(df1) <- c("id.mother", "yy"); df1
df2 <- merge(test.data, df1) ; df2
Sorry that I was unclear. For an individual to qualify for my analysis I
want both of the following two criteria to be fulfilled:
First, I want to select measurement taken at a certain age: for the
focal individual the year of measurement (year) should be the same as
year.hatch
Second, I want th
2 matches
Mail list logo