Friday, February 18, 2022

join with R & tidyverse

 well, this is just a reminder and a place to look for the exact syntax


require(tidyverse)

require(ggplot2)

peds=read_table2("renadd05.ped",      

        col_names=c("nid","ns","nd","varMS","yob",

               "numberKnownParents","numberOfRecords",

                "progenyAsSire","progenyAsDam","origId"),

        col_types="iiidiiiiic"

)

# this file has BLUP_noUPG and BLUP_MF already joined

rels=read_table2("acc_bf90_both",

        col_names=TRUE,

        col_types="iiiddiiidd"

)

rels$nid=rels$levelNoUPG

relpeds= rels %>% inner_join(peds,by="nid")

write_delim(relpeds,"acc_bf90_both_ped")