gen_freq {PROSPER} | R Documentation |
generating the start values for PROSPER models
Description
gen_freq
generates the numbers of genotypes at the beginning of the first simulated year.
Usage
gen_freq(
af,
n_seeds,
result = "initialSB",
distribution = NA,
max_vec_length = 1e+07
)
Arguments
af |
initial frequency of resistance alleles in the population. |
n_seeds |
initial number of weed seeds. They will be allocated to the genotypes. |
result |
names of the results columns. |
distribution |
defines the proportion with |
max_vec_length |
used internally, a technical term, defining the maximum length of vectors to be used. |
Details
The start values for a model include the initial frequencies of alleles and the initial seedbank, i.e. the number of seeds in the soil. gen_freq
allocates the n_seeds
individuals to the different genotypes as provided by dfgenotype
, which is created by struc_preparation2()
. If af == NULL
the function gives all seed to the only "genotype". The distribution can be splitted to multiple cohorts using distribution
.
If distribution
is "equal", n_seeds are distributed equaly amoung the cohorts defindes with result
.
Value
Returns a data.frame
containing the genotypes and their frequencies provided by dfgenotype
.
See Also
Examples
# generate a 'dfgenotype' data.frame:
struc_preparation2(Rmx=10, af=c(0.01,0.8), epis=0, dom=1)
#Distribute 10000 individuals of the starting population across the genotypes.
#The two gene loci have initial frequencies of 0.01 and 0.8.
gen_freq(af=c(0.01,0.8), n_seeds=10000)
rm(dfgenotype, mf, xprobab)