calc_areas: Function to calculate areas of classes within a categorical...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/supportFunc.R

Description

This function takes a categorical raster object and calculates the areas covered by each class within the raster.

Usage

1

Arguments

x

An object of class RasterLayer.

Details

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.

Value

A data frame with one column representing the values of the classes of the raster and the other variable representing corresponding areas in Ha.

Author(s)

Faustin Gashakamba

See Also

area

aggregate

values

Examples

1

hypsoLoop documentation built on Feb. 8, 2022, 9:07 a.m.