This is a quick tutorial to the use of package "landscapeR". In the following exercise, a landscape will be created from scratch and functionalities available in landscapeR will be used to simulate patterns of patches of different classes (could be habitats, land use types, etc.). All basic GIS operations are handled by the raster package.

Let's start loading the package and making an empty landscape (by transforming a matrix into a geographical object):

library(landscapeR)

library(raster)
m = matrix(0, 50, 50)
r = raster(m, xmn=0, xmx=10, ymn=0, ymx=10)

To create the profile of an area of interest (eg. could be a cathment) within the empty landscape the basic function to create a single patch is used starting from the centre of the landscape:

rr = makePatch(r, size=1500, spt=1275, rast=TRUE)
plot(rr)

Within this catchment, let's place randomly 10 patches of class "5", randomly sized between 10 and 50 cells. Background where patches must be placed is the catchment, with value 1, therefore bgr=1:

patchSize = sample(10:50, 5)
rr = makeClass(rr, 5, size=patchSize, val=5, rast=TRUE, bgr=1)
plot(rr)

Now let's add a linear feature:

rr = makeLine(rr, size=100, val=2, convol=0.05, rast=TRUE, bgr=1)
plot(rr)

Centred on a given point, let's populate some of the remainder on a gradient:



dariomasante/landscapeR documentation built on June 5, 2021, 10:47 a.m.