BoxplotSLCClasses {HYPEtools} | R Documentation |
Box plots of SLC distributions
Description
BoxplotSLCClasses
plots SLC class distributions for all SUBIDs in a GeoData data frame as boxplots. Boxes can represent distributions
of area fractions
Usage
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
)
Arguments
gd |
Data frame containing columns with SLC fractions, typically a 'GeoData.txt' file imported with |
gcl |
Data frame containing columns with SLCs and corresponding land use and soil class IDs, typically a 'GeoClass.txt'
file imported with |
col.landuse |
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 |
col.group |
Integer vector of the same length as the number of land use classes given in
|
lab.legend |
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 |
pos.legend |
Numeric, legend position in x direction. Given as position on the right hand outside of the plot area in x-axis units. |
abs.area |
Logical, if |
log |
Character string, passed to |
ylim |
Numeric vector of length 2, y-axis minimum and maximum. Set automatically if not specified. |
range |
Argument to |
mar , mgp , tcl , xaxs , xpd |
Arguments passed to |
Details
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.
Value
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.
Note
There is a maximum of 26 symbols available for marking soil classes. BoxplotSLCClasses
can be quite crowded, depending on the number of SLCs
in a model set-up. Tested and recommended plot device dimensions are 14 x 7 inches (width x height), e.g.:
> x11(width = 14, height = 7)
> png("mySLCdistri.png", width = 14, height = 7, units = "in", res = 600)
Examples
# 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)