generate_add: Additive Model for Fitness Landscapes

Description Usage Arguments Value Examples

View source: R/generate.R

Description

Generates a fitness landscape using the additive model, as characterized in Nagel et al. (2012) <doi:10.1534.genetics.111.132134>.

Usage

1
generate_add(n_gene, n_allele, wt_fit = 0, mut_fit)

Arguments

n_gene

number of genes

n_allele

number of alleles per gene

wt_fit

wild-type genotype fitness

mut_fit

if of class matrix, contains numeric fitness values for each allele and gene combination (each column is a gene, each row is an allele); if a function, must have zero parameters and return a single numeric value upon each call (it will be called repeatedly when generating the landscape)

Value

fitness landscape stored in FitLand class object

Examples

1
2
3
4
5
6
7
num_genes <- 4
num_alelles <- 3
landscape <- generate_add(num_genes,
                          num_alleles,
                          mut_fit = function() {stats::rnorm(1)})
                          
print(landscape)

rrrlw/fitness documentation built on Jan. 24, 2021, 3:05 a.m.