getAreaLoss {redlistr}R Documentation

Area change between two inputs in km2

Description

getAreaLoss reports the difference in area between two inputs. These can be RasterLayers, SpatialPolygons, SpatRaster, SpatVect, sf or numbers. Any combinations of these inputs are valid. If using number as input, ensure it is measured in km2

Usage

getAreaLoss(x, y)

Arguments

x

Spatial obect or numeric representing area in km2

y

Spatial object or numeric representing area in km2

Value

Returns the difference in area of the two inputs in km2

Author(s)

Nicholas Murray murr.nick@gmail.com, Calvin Lee calvinkflee@gmail.com

See Also

Other Change functions: getArea.RasterLayer(), getArea.SpatRaster(), getArea.SpatVect(), getArea.SpatialPolygons(), getArea.sf(), getArea(), getDeclineStats()

Examples

crs.UTM55S <- '+proj=utm +zone=55 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs'
r1 <- raster(ifelse((volcano<130), NA, 1), crs = crs.UTM55S)
extent(r1) <- extent(0, 6100, 0, 8700)
r2 <- raster(ifelse((volcano<145), NA, 1), crs = crs.UTM55S)
extent(r2) <- extent(0, 6100, 0, 8700)
a.dif <- getAreaLoss(r1, r2) # distribution rasters

[Package redlistr version 1.0.4 Index]