Learn R Programming

nprcgenekeepr (version 2.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

Dataframe with Id, Sex, and Current Age

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