I was trying to execute this functions, but I kept on getting an error with my if statment:
Error in if (unique(AGE$age[AGE$age[i]] > 60)) { : missing value where TRUE/FALSE needed
y<-NULL
for(i in unique(infofile$family)){
AGE<-infofile[infofile$family==i,]
if(unique(AGE$age[i]> 60)){
AGE$yearsold[i]<-"OLD"
}else{AGE$yearsold[i]<-"YOUNG"}
y<-rbind(y,AGE)
}
navalue forAGE$ageorunique(AGE$age[i]> 60condition doesn't match any row. - MKR