Open lwjohnst86 opened 6 years ago
To identify any other family relation (different from siblings) is necessary to use the left join function. We have to create one data table renaming the original id-fid-mid with grandparent, uncles, etc labels.
Pgp <- DT1[,c("id","fid","mid")] names(Pgp) <- c("fid","Fgp","Fgm") #left join DT2 <- Pgp[DT1, on="fid"] #Maternal Grandparents Mgp <- DT1[,c("id","fid","mid")] names(Mgp) <- c("mid","Mgp","Mgm") DT3 <- Mgp[DT1, on="mid"]
To identify any other family relation (different from siblings) is necessary to use the left join function. We have to create one data table renaming the original id-fid-mid with grandparent, uncles, etc labels.