Description Usage Arguments Value See Also Examples
View source: R/measure.operators.R
Calculate the area of objects in a raster
1 |
obj |
[ |
scale |
[ |
unit |
[ |
layer |
[ |
For scale = "landscape"
the area of the overall raster, for
scale = "class"
the total area of each unique value (class), for
scale = "patch"
the area of distinct objects per distinct values
(i.e. the area of patches per class).
Other generic metrics: mAdjacency
,
mNumber
, mPerimeter
,
mValues
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | cat <- rtRasters$categorical
bin <- rBinarise(rtRasters$continuous, thresh = 40)
# the area ...
# ... per landcover type
mArea(obj = cat, scale = "class")
# ... of patches per landcover type
mArea(obj = cat, scale = "patch")
# ... of certain values; from a binary raster, patches are
# automatically determined
require(magrittr)
rBinarise(obj = cat, match = c(41, 44, 47)) %>%
mArea(scale = "patch", layer = "values_binarised")
mArea(obj = bin, scale = "class")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.