BoxplotSLCClasses
plots SLC class distributions for all SUBIDs in a GeoData data frame as boxplots. Boxes can represent distributions
of area fractions
BoxplotSLCClasses(
gd,
gcl,
col.landuse = "rainbow",
col.group = NULL,
lab.legend = NULL,
pos.legend = 1,
abs.area = FALSE,
log = "",
ylim = NULL,
range = 0,
mar = c(3, 3, 1, 7) + 0.1,
mgp = c(1.5, 0.2, 0),
tcl = 0.1,
xaxs = "i",
xpd = TRUE
)
BoxplotSLCClasses
returns a plot to the currently active plot device, and invisibly a data frame of SLC class fractions with 0
values replaced by NA
s. If absolute areas are plotted, these are returned in the data frame.
Data frame containing columns with SLC fractions, typically a 'GeoData.txt' file imported with ReadGeoData
.
Data frame containing columns with SLCs and corresponding land use and soil class IDs, typically a 'GeoClass.txt'
file imported with ReadGeoClass
.
Specification of colors for box outlines, to represent land use classes. Either a keyword character string, or a vector of
colors with one element for each land use class as given in argument gcl
in ascending order. Possible keywords are 'rainbow'
(default)
or 'auto'
. 'rainbow'
triggers a generation of land use class colors using the rainbow
palette. 'auto'
triggers
generation of a pretty color palette with similar colors for land use groups. This option requires specification of land use groups in argument
col.group
.
Integer vector of the same length as the number of land use classes given in gcl
. Specifies a land use group ID for
each land use class ID, in ascending order. Groups and group IDs to use (in parentheses):
Water, snow, and ice (1)
Urban (2)
Forests (3)
Agriculture and pastures (4)
Natural non-forested (5)
Character string giving optional land use and soil class names to label the legend. Land use classes first, then soil classes.
Both following class IDs as given in gcl
in ascending order.
Numeric, legend position in x direction. Given as position on the right hand outside of the plot area in x-axis units.
Logical, if TRUE
, boxes will be plotted for absolute areas instead of area fractions.
Character string, passed to boxplot
. Empty string for linearly scaled axes, 'y'
for log scaled y-axis
(particularly in combination with abs.area = TRUE
).
Numeric vector of length 2, y-axis minimum and maximum. Set automatically if not specified.
Argument to boxplot
with changed default. See documentation in there.
Arguments passed to par
. See documentation in there.
BoxplotSLCClasses
allows to analyze the occurrence of individual SLCs in a given model set-up. both in terms of area fractions (SLC values)
and absolute areas. The function uses boxplot
to plot distributions of SLCs of all SUBIDs in a GeoData data frame. Land use classes
are color-coded, and soil classes marked by a point symbol below each box. Box whiskers extend to the data extremes.
# Import source data
te1 <- ReadGeoData(filename = system.file("demo_model", "GeoData.txt", package = "HYPEtools"))
te2 <- ReadGeoClass(filename = system.file("demo_model", "GeoClass.txt", package = "HYPEtools"))
BoxplotSLCClasses(gd = te1, gcl = te2)
Run the code above in your browser using DataLab