View source: R/change_functions.R
getAreaLoss | R Documentation |
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
getAreaLoss(x, y)
x |
Spatial obect or numeric representing area in km2 |
y |
Spatial object or numeric representing area in km2 |
Returns the difference in area of the two inputs in km2
Nicholas Murray murr.nick@gmail.com, Calvin Lee calvinkflee@gmail.com
Other Change functions:
getArea.RasterLayer()
,
getArea.SpatRaster()
,
getArea.SpatVect()
,
getArea.SpatialPolygons()
,
getArea.sf()
,
getArea()
,
getDeclineStats()
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.