| GroupSLCClasses {HYPEtools} | R Documentation |
Calculate grouped sums for SLC classes in a GeoData file
Description
GroupSLCClasses calculates grouped sums for SLC classes (area fractions or absolute areas) based on land use, soil, or crop groups in a GeoClass
table, or any other user-provided grouping index.
Usage
GroupSLCClasses(
gd,
gcl = NULL,
type = c("landuse", "soil", "crop"),
group = NULL,
abs.area = FALSE,
verbose = TRUE
)
Arguments
gd |
Data frame containing columns with SUBIDs, SLC fractions, and SUBID areas if |
gcl |
Data frame containing columns with SLCs and corresponding landuse and soil class IDs, typically a 'GeoClass.txt'
file imported with |
type |
Character string keyword for use with |
group |
Integer vector, of same length as number of SLC classes in |
abs.area |
Logical, if |
verbose |
Logical, if |
Details
If absolute areas are calculated, area units will correspond to areas provided in gd.
Value
GroupSLClasses returns the data frame with SUBIDs, SUBID areas, and grouped SLC class columns.
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"))
# Calculate soil groups
GroupSLCClasses(gd = te1, gcl = te2, type = "s")