Learn R Programming

landsepi (version 1.1.1)

setCultivars: Set cultivars

Description

Updates a LandsepiParams object with cultivars parameters

Usage

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,

  • death rate: host death 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):

cultivarName initial_density max_density growth_rate reproduction_rate death_rate yield_H yield_L yield_I yield_R planting_cost market_value
Susceptible 0.1 2.0 0.1 0.0 0.0 2.5 0.0 0.0 0.0 225 200
Resistant1 0.1 2.0 0.1 0.0 0.0 2.5 0.0 0.0 0.0 225 200
Resistant2 0.1 2.0 0.1 0.0 0.0 2.5 0.0 0.0 0.0 225 200

See Also

loadCultivar

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab