Last chance! 50% off unlimited learning
Sale ends in
Updates a given croptype by allocating cultivars composing it.
allocateCroptypeCultivars(
croptypes,
croptypeName,
cultivarsInCroptype,
prop = NULL
)
a croptype data.frame updated for the concerned croptype.
a dataframe containing all croptypes, initialised via
loadCroptypes
the name of the croptype to be allocated
name of cultivars composing the croptype
vector of proportions of each cultivar in the croptype. Default to balanced proportions.
setCroptypes, setCultivars
if (FALSE) {
simul_params <- createSimulParams()
cultivar1 <- loadCultivar(name = "Susceptible", type = "wheat")
cultivar2 <- loadCultivar(name = "Resistant1", type = "wheat")
cultivar3 <- loadCultivar(name = "Resistant2", type = "wheat")
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
}
Run the code above in your browser using DataLab