Learn R Programming

optiSel (version 2.0.7)

conttac: Calculates Contributions To Age Cohorts

Description

Calculates genetic contributions of other breeds to age cohorts

Usage

conttac(cont, cohort, use=rep(TRUE,length(cohort)), mincont=0.05, long=TRUE)

Value

Data frame containing the genetic contribution from every breed to every age cohort.

Arguments

cont

Data frame containing the genetic contributions of several ancestors or breeds to all individuals. This is typically the output of function pedBreedComp.

cohort

Numeric vector indicating for every individual the age cohort to which it belongs (typically year of birth).

use

Logical vector indicating for every individual whether it should be included in an age cohort (typically TRUE for individuals belonging to the breed of interest).

mincont

Contributions of breeeds with average contribution smaller than mincont will be summarized in one row

long

Should the resutling data frame be melted for easy plotting?

Author

Robin Wellmann

Details

The genetic contributions from other breeds to all age cohorts are computed. The genetic contribution from a breed is the fraction of genes in the gene pool originating from the respective breed.

Examples

Run this code
data(ExamplePed)
Pedig      <- prePed(ExamplePed, thisBreed="Hinterwaelder", lastNative=1970)
cont       <- pedBreedComp(Pedig, thisBreed="Hinterwaelder")
contByYear <- conttac(cont, Pedig$Born, use=Pedig$Breed=="Hinterwaelder", mincont=0.04, long=FALSE)
round(contByYear,2)

barplot(contByYear, ylim=c(0,1), col=1:10, ylab="genetic contribution",
        legend=TRUE, args.legend=list(x="bottomleft",cex=0.5))

Run the code above in your browser using DataLab