AOH.estimation: Terrestrial Area of Habitat

View source: R/AOH.estimation.R

AOH.estimationR Documentation

Terrestrial Area of Habitat

Description

[Experimental] The function compute the amount of 'habitat' within the EOO of each species, which may represent habitat itself or any other proxy, value or category the user may find relevant (e.g. area covered by protected areas, altitude, etc...). If two or more time intervals are provided, the function also returns the habitat change between intervals. Currently, the type of habitat maps objects currently accepted are sp, sf and Raster*. In addition, habitat change is only computed for rasters (e.g. RasterStack object).

Usage

AOH.estimation(
  XY,
  show_progress = TRUE,
  proj_type = "cea",
  mode = "planar",
  hab.map = NULL,
  hab.map.type = NULL,
  hab.class = NULL,
  years = NULL,
  country_map = NULL,
  exclude.area = TRUE,
  parallel = FALSE,
  NbeCores = 2,
  simplifiy_poly = TRUE,
  buffer = NULL,
  ...
)

Arguments

XY

"dataframe" see Details

show_progress

logical. whether a bar showing progress in computation should be shown. Default to TRUE.

proj_type

character string, numeric or object of CRS class. Default to "cea".

mode

character string either 'spheroid' or 'planar'. By default 'spheroid'

hab.map

SpatRaster or sf containing the habitat spatial information

hab.map.type

logical, vector of same length of hab.map, if TRUE means hab.map is suitable for species, if FALSE unsuitable

hab.class

classes of values in hab.map to be considered as 'habitat'.

years

numeric. Time interval between the first and last hab.map if more than one SpatRaster is provided (e.g. if hab.map is a SpatRaster object).

country_map

a sf

exclude.area

a logical, if TRUE, areas outside of country_map are cropped of SpatialPolygons used for calculating EOO. By default is FALSE

parallel

logical. Should computing run in parallel? Default to FALSE.

NbeCores

integer. The number of cores for parallel execution. Default to 2.

simplifiy_poly

logical whether the resulting polygon should be simplified using ms_simplify function of rmapshaper package

buffer

numeric

...

additional arguments passed to EOO.computing

SpatialPolygons showing for example countries or continent borders. This shapefile will be used for cropping the SpatialPolygonsl if exclude.area is TRUE

Details

If multiple rasters are provided, the last raster is taken as the most recent one to calculate current habitat proportion and area. Similarly, the first and last rasters are used to calculate habitat change. In this case the user should provide the interval in years between the two rasters. If this interval is not provided the function assumes the number of rasters provided minus one as the 'default' time interval.

For faster processing of maps, the function automatically crops the EOO polygons to the extent of the hab.map provided. Then, for each taxon, the hab.map is cropped to the extent of the taxon EOO polygon. If the taxon EOO and the raster provided don't intersect the functions returns NA.

If the size of the EOO is too small in respect to the raster resolution (small enough to contain an entire pixel) or if the EOO polygon is elongated (perimeter/area relationship > 2), the function returns the estimates for all pixels touching the species EOO boundaries and not only the pixels within the EOO. However, if the EOO polygon is small enough to fit entirely within a pixel, metrics will refer to this single pixel. So, make sure that the resolution of the rasters provided make sense to the range of the taxa being assessed.

Value

If hab.map is a *Raster object with categorical variables, the function returns a data frame containing the taxon name (tax), the percentage of habitat within the taxon EOO (prop.EOO) and the approximate area that this percentage represents. If habitat change is also estimated the function returns additional columns, namely:

  • the total percentage loss and recover of habitat within the EOO (loss, recover);

  • the percentage loss and recover relative to the amount of habitat and non-habitat within the EOO at the beginning of the time interval (rel.loss, rel.recover);

  • the annual rate of habitat loss and recover (rate.loss, rate.recover, i.e. rel.loss and rel.recover divided by years);

  • A habitat quality index which is obtained by averaging values of quality to pixels according to their transition between the first and last year of the times series, namely habitat to habitat = 2, non-habitat to habitat = 1, non-habitat to non-habitat = 0, and habitat to non-habitat = -1 (hab.quality, hab.quality.lo, hab.quality.hi). The index thus vary from -1 (i.e., all pixels were habitat in time one and all was lost in time two) until 2 (i.e., all pixels were habitat in time one and they remained so in time 2).

If hab.map is a *Raster object with continuous variables, the function returns a data frame containing the taxon name (tax), and, by default, the summary statistics of all pixels within the taxon EOO. If argument output_raster is "prop.table" the function return the proportion of each pixel value within the taxon EOO and if it is "area.table" it returns the approximate area of each pixel value within the taxon EOO.

If hab.map is a 'sp' or 'sf' object with multiple polygons, the function returns a data frame containing the taxon name (tax), the number of unique polygons (numb.polys), the percentage of area (prop.EOO) and the total area of the polygons within the taxon EOO.

If export_shp is TRUE, the function also returns the transition rasters used to calculated 'hab.quality' or the cropped polygons in the case of polygons. But note that for rasters, this include additional steps that can be time and memory consuming.


gdauby/ConR documentation built on Jan. 30, 2024, 11:10 p.m.