getPedigree: Get population pedigree.

View source: R/Population_getters.R

getPedigreeR Documentation

Get population pedigree.

Description

Retrieve the pedigree of a Population object.

Usage

getPedigree(pop)

Arguments

pop

a valid object of class Population.

Details

getPedigree() can be used to retrieve the pedigree of a population, including the phenotypic components of all individuals in the pedigree.

Value

A data.frame containing vectors for each individual's ID, its sire and dam IDs, and its phenotypic components, across the pedigree.

Author(s)

Dion Detterer, Paul Kwan, Cedric Gondro

See Also

runSim

Examples


# Construct a population with additive and epistatic effects
pop <- Population(
  popSize = 200, map = map100snp, QTL = 20,
  alleleFrequencies = runif(100),
  broadH2 = 0.9, narrowh2 = 0.6, traitVar = 40
)
pop <- addEffects(pop)
pop <- attachEpiNet(pop)

# Run the simulator
pop2 <- runSim(pop, generations = 150)

# Retrieve the population pedigree from the simulation
ped <- getPedigree(pop2)

# Re-run the simulation using the same pedigree
pop3 <- runSim(pop, ped)


epinetr documentation built on March 18, 2022, 7:01 p.m.