Skip to contents

Forms a dataframe with Id, Sex, and current Age given a list of Ids and a pedigree

Usage

addSexAndAgeToGroup(ids, ped)

Arguments

ids

character vector of animal Ids

ped

datatable that is the Pedigree. It contains pedigree information including the IDs listed in candidates.

Value

Dataframe with Id, Sex, and Current Age

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.34155
#> C1ICXL C1ICXL   F 10.31896
#> J3D3N5 J3D3N5   M 25.39083
#> VFS0XB VFS0XB   M 20.38604
#> HP3E04 HP3E04   M 19.23340
#> 2KULR3 2KULR3   F 12.99658