allocateCroptypeCultivars {landsepi} | R Documentation |
Allocate cultivars to one croptype
Description
Updates a given croptype by allocating cultivars composing it.
Usage
allocateCroptypeCultivars(
croptypes,
croptypeName,
cultivarsInCroptype,
prop = NULL
)
Arguments
croptypes |
a dataframe containing all croptypes, initialised via
|
croptypeName |
the name of the croptype to be allocated |
cultivarsInCroptype |
name of cultivars composing the croptype |
prop |
vector of proportions of each cultivar in the croptype. Default to balanced proportions. |
Value
a croptype data.frame updated for the concerned croptype.
See Also
Examples
## Not run:
simul_params <- createSimulParams()
cultivar1 <- loadCultivar(name = "Susceptible", type = "growingHost")
cultivar2 <- loadCultivar(name = "Resistant1", type = "growingHost")
cultivar3 <- loadCultivar(name = "Resistant2", type = "growingHost")
cultivars <- data.frame(rbind(cultivar1, cultivar2, cultivar3), stringsAsFactors = FALSE)
simul_params <- setCultivars(simul_params, cultivars)
croptypes <- loadCroptypes(simul_params, names = c("Susceptible crop", "Mixture"))
croptypes
croptypes <- allocateCroptypeCultivars(croptypes, "Susceptible crop", "Susceptible")
croptypes <- allocateCroptypeCultivars(croptypes, "Mixture", c("Resistant1", "Resistant2"))
croptypes
## End(Not run)
[Package landsepi version 1.4.0 Index]