
Build a group data frame with ID, sex, and age
Source:R/addSexAndAgeToGroup.R
addSexAndAgeToGroup.RdBuild a group data frame with ID, sex, and age
Value
A data frame with columns ids, sex and age
(current age). Every id must occur exactly once in ped$id; an id
that is missing from or duplicated in ped causes an error rather
than an NA.
Details
An empty ids vector yields a zero-row data frame that still
contains all three columns (ids, sex, age), with
sex an empty factor, so the returned schema does not depend on the
number of ids supplied.
Examples
library(nprcgenekeepr)
data("qcBreeders")
data("qcPed")
df <- addSexAndAgeToGroup(ids = qcBreeders, ped = qcPed)
head(df)
#> ids sex age
#> Q0RGP7 Q0RGP7 F 21.68378
#> C1ICXL C1ICXL F 10.66119
#> J3D3N5 J3D3N5 M 25.73306
#> VFS0XB VFS0XB M 20.72827
#> HP3E04 HP3E04 M 19.57563
#> 2KULR3 2KULR3 F 13.33881