wos_sim: wos_sim run a series of resistance evolution simulations to...

Description Usage Arguments Value Examples

View source: R/wos_sim.r

Description

requires either a dataframe with columns for genotype, x (e.g. time) and y (e.g.mortality) or vectors of x, and yrr,ysr,yss

Usage

1
2
3
4
5
wos_sim(dfmortbygen = NULL, x = "concentration", y = "mortality",
  concs = c(1:5), mort_rr = c(0, 0, 0, 0.5, 1), mort_sr = c(0, 0,
  0.5, 1, 1), mort_ss = c(0, 0.5, 1, 1, 1), exposure = 0.5,
  max_gen = 1000, no_thresh = NA, startfreq = 0.001,
  dominances = c(0, 0.1, 1), plot = TRUE)

Arguments

dfmortbygen

dataframe of mortality by genotype, an alternative way of initialising function, needs genotype column

x

column name of x in dfmortbygen

y

column name of y in dfmortbygen

concs

concentration or time

mort_rr

rr mortalities 0-1

mort_sr

sr mortalities 0-1

mort_ss

ss mortalities 0-1

exposure

proportion of popn exposed to insecticide only used in the simulations

max_gen

maximum generations to use in the simulations

no_thresh

what to return as time-to-resistance if threshold not reached

startfreq

starting frequency to use in the simulations

dominances

only if there are no SR values which dominances to run

plot

whether to plot

Value

dataframe of simulation outputs

Examples

1
2
3
4
5
6
dfsim <- wos_sim()
dfsim <- wos_sim(dfmortbygen=dplyr::data_frame(conc=rep(c(1,2),3),
                               genotype=rep(c('RR','SR','SS'),each=2),
                               mort=c(0,0.2,0.4,0.6,0.8,1)),
        x='conc',y='mort')
#with no sr data runs dom0,0.1&1

AndySouth/wos documentation built on Nov. 15, 2019, 10:05 a.m.