setPheno {AlphaSimR} | R Documentation |
Sets phenotypes for all traits by adding random error from a multivariate normal distribution.
setPheno(pop, varE = NULL, reps = 1, fixEff = 1L, p = 0.5, onlyPheno = FALSE, simParam = NULL)
pop |
an object of |
varE |
error variances for phenotype. A vector of length nTraits for independent error or a square matrix of dimensions nTraits for correlated errors. If NULL, value in simParam is used. |
reps |
number of replications for phenotype. See details. |
fixEff |
fixed effect to assign to the population. Used by genomic selection models only. |
p |
the p-value for the environmental covariate used by GxE traits. |
onlyPheno |
should only the phenotype be returned, see return |
simParam |
an object of |
The reps parameter is for convient representation of replicated data. It is intended to represent replicated yield trials in plant breeding programs. In this case, varE is set to the plot error and reps is set to the number of plots per entry. The resulting phenotype represents entry means.
Returns an object of Pop-class
or
HybridPop-class
if onlyPheno=FALSE, if
onlyPheno=TRUE a matrix is returned
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitA(10) #Create population pop = newPop(founderPop, simParam=SP) #Add phenotype with error variance of 1 pop = setPheno(pop, varE=1)