conttac: Calculates *Cont*ributions *T*o *A*ge *C*ohorts

conttacR Documentation

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)

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?

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.

Value

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

Author(s)

Robin Wellmann

Examples

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))


optiSel documentation built on June 22, 2024, 11:27 a.m.