loadCroptypes.Rd
Creates a data.frame containing croptype parameters and filled with 0
loadCroptypes(params, croptypeIDs = NULL, names = NULL)
a LandsepiParams Object.
a vector of indices of croptypes (must start at 0 and match with croptype IDs in the landscape)
a vector containing the names of all croptypes
a data.frame with croptype parameters
Croptypes need to be later updated with allocateCroptypeCultivars
.
If neither croptypeIDs nor names are given, it will automatically generate
1 croptype per cultivar.
if (FALSE) {
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
}