addEffects | R Documentation |
Attach additive effects to a Population
object.
addEffects(pop, effects = NULL, distrib = rnorm)
pop |
an object of class |
effects |
an optional vector of additive effect coefficients. |
distrib |
an optional random number generator function for a
distribution, defaulting to |
addEffects()
is a function for attaching additive effects to a given
population, ensuring that the initial additive variance is as given in the
population parameters.
If additive effect coefficients are directly supplied via the effects
vector, these may be scaled in order to comply with the initial additive
variance.
A copy of the supplied Population
object is returned, with
additive effects attached.
Dion Detterer, Paul Kwan, Cedric Gondro
Population
, attachEpiNet
# Create population pop <- Population( popSize = 200, map = map100snp, QTL = 20, alleleFrequencies = runif(100), broadH2 = 0.9, narrowh2 = 0.6, traitVar = 40 ) # Attach additive effects using a normal distribution pop <- addEffects(pop) # Attach additive effects using a uniform distribution pop2 <- addEffects(pop, distrib = runif) # Attach additive effects using a vector of coefficients effects <- c( 1.2, 1.5, -0.3, -1.4, 0.8, 2.4, 0.2, -0.8, -0.4, 0.8, -0.2, -1.4, 1.4, 0.2, -0.9, 0.4, -0.8, 0.0, -1.1, -1.3 ) pop3 <- addEffects(pop, effects = effects) # Print first population pop # Print second population pop2 # Print third population pop3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.