Creates a data.frame containing croptype parameters and filled with 0

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

Value

a data.frame with croptype parameters

Details

Croptypes need to be later updated with allocateCroptypeCultivars. If neither croptypeIDs nor names are given, it will automatically generate 1 croptype per cultivar.

See also

Examples

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
}