disturbanceMetrics: Calculate metrics of natural and anthropogenic disturbance

View source: R/disturbanceMetrics.R

disturbanceMetricsR Documentation

Calculate metrics of natural and anthropogenic disturbance

Description

Calculate the predictors described in Table 52 of Environment Canada (2011) Scientific Assessment to Inform the Identification of Critical Habitat for Woodland Caribou (Rangifer tarandus caribou), Boreal Population, in Canada:2011 Update. Ottawa, Ontario.The variables calculated by this function include:

  • Fire: % fire

  • Anthro: % non-overlapping anthropogenic disturbance.

  • Total_dist: Percent total non-overlapping fire and anthropogenic disturbance.

  • fire_excl_anthro: % fire not overlapping with anthropogenic disturbance.

Usage

disturbanceMetrics(
  landCover = NULL,
  linFeat = NULL,
  projectPoly = NULL,
  isPercent = TRUE,
  ...
)

Arguments

landCover

filename, SpatRaster or RasterLayer. 0 and NA values are assumed to be water and omitted from the tabulated area. Note landCover is also used to define the input grid, so must be provided even if all values are 1.

linFeat

filename, SpatRaster, RasterLayer, sf object or a list of these that will be combined. Linear features.

projectPoly

filename or sf object. Polygons defining range boundaries.

isPercent

logical. Should the results be returned as a percentage?

...

optional arguments:

  • natDist: filename, SpatRaster or RasterLayer. Presence or absence of natural disturbance, primarily by fire. Should include 40 years cumulative disturbance.

  • anthroDist: filename, SpatRaster or RasterLayer. Anthropogenic disturbance including harvest. This can have an effect on any type of landcover except water. Should include 40 years cumulative disturbance.

  • padProjPoly: logical. Should the area around the projectPoly be used to avoid edge effects? If FALSE, the default, only data from inside the projectPoly is used. If TRUE then projectPoly is buffered and the other variables are clipped to the extent of the buffered area. Results are always clipped to the original projectPoly. It is ideal to set this to TRUE and provide a dataset that is larger than the projectPoly to avoid edge effects.

  • padFocal: logical. This value is passed to the pad argument in terra::focal, if it is FALSE then cells near the edge will return NA, if it is TRUE a value will be returned for each cell that assumes cells outside the input data are 0 for all resource types. This is not a good assumption and should be used with caution.

  • bufferWidth: number. Width of buffer applied to anthropogenic disturbance in metres. Default is 500.

  • linBuffMethod: character. The method used to buffer linear features if they are supplied as sf lines. The default is "raster" in which case they are rasterized and then buffered using a moving window method. If "sf" then the lines are buffered with st_buffer and then rasterized. Either way points are included in the raster output.

  • saveOutput: character. The filename to save the raster of binary disturbances with buffered anthropogenic disturbance. Note this will overwrite existing files with the same name. The .grd format is recommended because it will preserve layer names when the file is reloaded.

  • preppedData: list. A list containing pre-prepared input data sets. If not NULL then data checks will be skipped. Names must match argument names except that landCover should be called refRast and projectPoly should be called projectPolyOrig See loadSpatialInputs().

Details

Note assume natDist and anthroDist include 40 years of cumulative disturbance. Note that locations where landCover is NA or 0 are omitted from the tabulated area. Missing layers are omitted from the output, not interpreted as 0 disturbance. To update an existing DisturbanceMetrics object with new data see updateDisturbance().

Value

A DisturbanceMetrics Object see DisturbanceMetrics-class()

Source

Environment Canada. 2011. Scientific Assessment to Inform the Identification of Critical Habitat for Woodland Caribou (Rangifer tarandus caribou), Boreal Population, in Canada:2011 Update. Ottawa, Ontario.

See Also

DisturbanceMetrics-class() for information on the object returned and updateDisturbance() for updating an existing DisturbanceMetrics object.

Functions for calculating disturbance: DisturbanceMetrics-class, reclassDist(), results(), updateDisturbance()

Examples

# create example rasters
lc <- terra::rast(nrows = 10, ncols = 10, xmin = 0, xmax = 10, ymin = 0,
                  ymax = 10, crs = "EPSG:5070")
nd <- lc
nd[1:3, 1:3] <- 1
ad <- lc
ad[3:5, 3:5] <- 1
lc[] <- 1

# create sf objects
lf <- sf::st_as_sf(sf::st_sfc(list(sf::st_linestring(matrix(c(0, 0, 10, 10), 
                                                            ncol = 2, byrow = TRUE))),
                              crs = 5070))
projPol <- sf::st_sf(sf::st_as_sfc(sf::st_bbox(ad)))

# calculate disturbance
disturbanceMetrics(landCover = lc,
                   linFeat = lf,
                   natDist = nd,
                   anthroDist = ad,
                   projectPoly = projPol,
                   padFocal = TRUE,
                   bufferWidth = 1)


LandSciTech/caribouMetrics documentation built on Feb. 3, 2024, 9:41 p.m.