parentAverage: Calculate parent average

View source: R/popSummary.R

parentAverageR Documentation

Calculate parent average

Description

Calculate parent average

Usage

parentAverage(
  pop,
  parents = NULL,
  mothers = NULL,
  fathers = NULL,
  use = "gv",
  simParam = NULL
)

Arguments

pop

Pop-class with individuals whose parent average will be calculated

parents

Pop-class with mothers and fathers of individuals in pop; if NULL must provide mothers and fathers

mothers

Pop-class with mothers of individuals in pop; if NULL must provide parents

fathers

Pop-class with fathers of individuals in pop; if NULL must provide parents

use

character, calculate using "gv", "bv", "ebv", or "pheno"

simParam

SimParam object

Value

a matrix of parent averages with dimensions nInd by nTraits

Examples

#Create founder haplotypes
founderPop = quickHaplo(nInd=10, nChr=1, segSites=10)

#Set simulation parameters
SP = SimParam$new(founderPop)
SP$addTraitAD(10, meanDD=0.5)
SP$setVarE(h2=0.5)


#Create population
pop = newPop(founderPop, simParam=SP)
pop2 = randCross(pop, nCrosses=10, nProgeny=2)
parentAverage(pop2, parents = pop)
parentAverage(pop2, mothers = pop, fathers = pop)


AlphaSimR documentation built on Nov. 8, 2025, 5:10 p.m.