Updates a LandsepiParams object with a sp or sf object as landscape.

setLandscape(params, land)

Arguments

params

a LandsepiParams Object.

land

a landscape as sp or sf object

Value

a LandsepiParams object.

Details

The landscape should be a sp or sf object. Built-in landscape are available using loadLandscape. See our tutorial (vignettes) for details on how to use your own landscape. If the landscape contains only polygons, croptypes can be allocated later using allocateLandscapeCroptypes. Otherwise the landscape has to contain a data.frame specifying for every year, the index of the croptype cultivated in each polygon. Each features has a field identified by "year_XX" (XX <- seq(1:Nyears+1)) and containing the croptype ID.

Features/fieldsyear_1year_2... year_Nyears+1
polygons1131013
polygonsX212

See also

Examples

if (FALSE) {
simul_params <- createSimulParams()
simul_params <- setLandscape(simul_params, loadLandscape(1))
simul_params@Landscape
}