- x
A SpatRaster object for which the area of each layer will be calculated.
This SpatRaster can have one or multiple layers.
- y
An optional SpatRaster object with a single layer. If provided,
the overlapping area between each layer in x and this y raster will be calculated.
It should have the same extent and resolution as x.
- z
An optional SpatRaster object with a single layer. If provided,
the overlapping area between each layer in x and this z raster,
as well as the three-way overlap (x, y, and z), will be calculated.
Requires y to also be provided. It should have the same extent and resolution as x.
- filename
Character string. If provided (e.g., "results.csv"), the resulting
data frame will be saved to a CSV file with this name. If not provided,
results are returned only to the R session.
- unit
Character string specifying the unit of measurement for area calculations.
Defaults to "km" (kilometers). Other options include "ha" (hectares), "m" (meters), etc.
- cellsize
Numeric. An optional value specifying the cell size (area of a single cell)
to be used for calculations. If NULL (default), the function will
automatically determine the cell size from the input raster x.