Updates a LandsepiParams object with cultivars parameters

setCultivars(params, dfCultivars)

Arguments

params

a landsepiParams object.

dfCultivars

a data.frame defining the cultivars (see details). It can be generated manually or, alternatively, via loadCultivar.

Value

a LandsepiParams object

Details

dfCultivars is a dataframe of parameters associated with each host genotype (i.e. cultivars, lines) when cultivated in pure crops. Columns of the dataframe are:

  • cultivarName: cultivar names (cannot accept space),

  • initial_density: host densities (per square meter) at the beginning of the cropping season as if cultivated in pure crop,

  • max_density: maximum host densities (per square meter) at the end of the cropping season as if cultivated in pure crop,

  • growth rate: host growth rates,

  • reproduction rate: host reproduction rates,

  • yield_H: theoretical yield (in weight or volume units / ha / cropping season) associated with hosts in sanitary status H as if cultivated in pure crop,

  • yield_L: theoretical yield (in weight or volume units / ha / cropping season) associated with hosts in sanitary status L as if cultivated in pure crop,

  • yield_I: theoretical yield (in weight or volume units / ha / cropping season) associated with hosts in sanitary status I as if cultivated in pure crop,

  • yield_R: theoretical yield (in weight or volume units / ha / cropping season) associated with hosts in sanitary status R as if cultivated in pure crop,

  • planting_cost = planting costs (in monetary units / ha / cropping season) as if cultivated in pure crop,

  • market_value = market values of the production (in monetary units / weight or volume unit).

The data.frame must be defined as follow (example):

cultivarNameinitial_densitymax_densitygrowth_ratereproduction_rateyield_Hyield_Lyield_Iyield_Rplanting_costmarket_value
Susceptible0.12.00.10.02.50.00.00.0225200
Resistant10.12.00.10.02.50.00.00.0225200
Resistant20.12.00.10.02.50.00.00.0225200

See also

Examples

if (FALSE) {
simul_params <- createSimulParams()
cultivar1 <- loadCultivar(name = "Susceptible", type = "growingHost")
cultivar2 <- loadCultivar(name = "Resistant", type = "growingHost")
cultivars <- data.frame(rbind(cultivar1, cultivar2), stringsAsFactors = FALSE)
simul_params <- setCultivars(simul_params, cultivars)
simul_params@Cultivars
}