lwjohnst86 / famnet

Characterizing a Family Network
Other
0 stars 0 forks source link

Function to determine aunts and uncles #4

Open lwjohnst86 opened 6 years ago

omarsilverman commented 6 years ago

To identify uncle and aunts we have to left join the data table (id,fid,mid) by fid and mid, renaming the sibling data table.

DT <- c("id","fid","mid")
Fua <- Fsib
names(Fua) <- c("fid","Funcle","Faunt")

DT2 <- DT[Fua, on="fid"]

Mua <- Fsib
names(Mua) <- c("mid","Muncle","Maunt")

DT3 <- Mua[DT, on="mid"]

The next step will be to merge with original data table (id, fid, mid)