assignStrainTraits {microPop} | R Documentation |
Internal function to assign stochastic strain traits
Description
Produces a random distribution of trait values where the mean is groupVal and the range is determined by strainOptions$percentTraitRange (if not pHtrait) and by maxPHshift if it is the pHtrait (see strainOptions)
Usage
assignStrainTraits(
numStrains,
groupVal,
strainOptions,
parName = "unspecified param",
pHtrait = FALSE,
gname = "None"
)
Arguments
numStrains |
Integer. Number of strains per group |
groupVal |
Scalar. Group parameter value i.e. the mean parameter value |
strainOptions |
list from microPopModel inputs. Contains 'distribution' i.e. the shape of the distribution ('normal' or 'uniform'). If it is not for a pH trait and the distribution is 'normal' then its std dev is groupVal*percentRange/200, if distribution is 'uniform' then its range is groupVal*(1 +/- percentRange/100). For a pH trait, 'maxPHshift' is the max shift in pH units and 'normal' has std dev = maxPHshift/2, and 'uniform' distribution has range groupVal +/- maxPHshift; |
parName |
Name of parameter. This is only used to help with error catching |
pHtrait |
TRUE/FALSE whether or not trait is the pH trait. |
gname |
Microbe name (for indexing strainOptions$percentTraitRange) |
Value
vector of values for each strain for one parameter