View source: R/function_GroupSLCClasses.R
GroupSLCClasses | R Documentation |
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.
GroupSLCClasses(
gd,
gcl = NULL,
type = c("landuse", "soil", "crop"),
group = NULL,
abs.area = FALSE,
verbose = TRUE
)
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 |
If absolute areas are calculated, area units will correspond to areas provided in gd
.
GroupSLClasses
returns the data frame with SUBIDs, SUBID areas, and grouped SLC class columns.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.