Re: [R] [Fwd: Re: subsetting]

2007-10-26 Thread John Kane
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

[R] [Fwd: Re: subsetting]

2007-10-26 Thread henrik . parn
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