Description Usage Arguments Details Value Author(s) See Also Examples
This function takes a categorical raster object and calculates the areas covered by each class within the raster.
1 | calc_areas(x)
|
x |
An object of class RasterLayer. |
The raster package's "area()" function normally returns the same raster where cell values have been replaced by their areas in Square Km. Using this function, the values of all cells of same class are aggregated and the raster is transformed into a data frame. If the CRS of the input raster is projected, then the area is calculated by multiplying the resolution of the raster by the count of cells for each class.
A data frame with one column representing the values of the classes of the raster and the other variable representing corresponding areas in Ha.
Faustin Gashakamba
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.