Learn R Programming

nprcgenekeepr (version 3.0.0)

addSexAndAgeToGroup: Build a group data frame with ID, sex, and age

Description

Build a group data frame with ID, sex, and age

Usage

addSexAndAgeToGroup(ids, ped)

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.

Arguments

ids

character vector of animal IDs

ped

The pedigree information in data.frame format

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

Run this code
library(nprcgenekeepr)
data("qcBreeders")
data("qcPed")
df <- addSexAndAgeToGroup(ids = qcBreeders, ped = qcPed)
head(df)

Run the code above in your browser using DataLab