loadCroptypes {landsepi} | R Documentation |
Load Croptypes
Description
Creates a data.frame containing croptype parameters and filled with 0
Usage
loadCroptypes(params, croptypeIDs = NULL, names = NULL)
Arguments
params |
a LandsepiParams Object. |
croptypeIDs |
a vector of indices of croptypes (must start at 0 and match with croptype IDs in the landscape) |
names |
a vector containing the names of all croptypes |
Details
Croptypes need to be later updated with allocateCroptypeCultivars
.
If neither croptypeIDs nor names are given, it will automatically generate
1 croptype per cultivar.
Value
a data.frame with croptype parameters
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
## End(Not run)
[Package landsepi version 1.4.0 Index]