Learn R Programming

landsepi (version 1.1.1)

setLansdcape: Set the landscape

Description

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

Usage

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/fields year_1 year_2 ... year_Nyears+1
polygons1 13 10 13
polygonsX 2 1 2

See Also

loadLandscape

Examples

Run this code
# NOT RUN {
simul_params <- createSimulParams()
simul_params <- setLandscape(simul_params, loadLandscape(1))
simul_params@Landscape
# }

Run the code above in your browser using DataLab