Skip to contents

This function calculates the areas of LCZ classes in both percentage and square kilometers.

Usage

lcz_cal_area(
  x,
  iplot = TRUE,
  isave = FALSE,
  inclusive = FALSE,
  xlab = "LCZ code",
  ylab = "Area [square kilometer]",
  ...
)

Arguments

x

A raster SpatRaster layer containing LCZ classes.

iplot

Logical, indicating whether to create a plot (default is TRUE).

isave

Save the plot into your directory.

inclusive

Set to TRUE to a colorblind-friendly palette.

xlab

x-axis name.

ylab

y-axis name.

...

Additional arguments to modify axis, legend, and plot labels, including title, subtitle and caption.

Value

A summary table of LCZ class areas if iplot is FALSE, otherwise, a bar plot.

See also

See the documentation for lcz_get_map() to obtain an LCZ map.

Examples

if (FALSE) { # \dontrun{
#Calculate the LCZ area
my_lcz_area <- lcz_cal_area(my_lcz_map, iplot = TRUE, isave = TRUE)
} # }