gen_diploid: Diploid genetics: recombination of alleles

Description Usage Arguments Details Value warning See Also Examples

View source: R/gen_diploid.R

Description

gen_diploid recombines the alleles of weeds with diploid genome.

Usage

1
2
3
4
5
6
7
gen_diploid(
  start,
  start_comb = NA,
  result,
  newseeds = get0("newseeds", envir = parent.frame(n = 1)),
  max_vec_length = 1e+07
)

Arguments

start

column names of parental cohorts. character vector.

start_comb

all named columns in start are joined and returned as a column with the name of start_comb (character). Only used when start longer than 1.

result

name of the results column. character.

newseeds

number of new seeds calculated by pop_reprod. positive integer.

max_vec_length

used internally, a technical term, defining the maximum length of vectors to be used.

Details

gen_diploid assumes independent allele recombination.

Value

A column with the name of result and, if necessary, a column with the name of start_comb is added to the data.frame dfgenotype.

warning

newseeds are always coerced to a whole number.

See Also

pop_reprod

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
# generate a 'dfgenotype' data.frame:
struc_preparation2(Rmx=10, af=c(0.01, 0.2), 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)
# The column "initialSB" represents the parent generation, which recombines and 
#therefore defines the genetics of the new seeds
newseeds <- 10000
gen_diploid(start="initialSB", result="followingSB")
# If a second cohort is reprodusing in the same time
gen_diploid(start=c("initialSB", "followingSB"), 
                  start_comb="two_cohorts_combind", result="followingSB2")
rm(dfgenotype, mf, newseeds, xprobab)

## End(Not run)

PROSPER documentation built on July 2, 2020, 3:25 a.m.

Related to gen_diploid in PROSPER...