SumSLCClasses: Calculate sums of SLC classes in a GeoData file

View source: R/function_SumSLCClasses.R

SumSLCClassesR Documentation

Calculate sums of SLC classes in a GeoData file

Description

SumSLCClasses sums all SLC classes for each SUBID in a GeoData data frame and optionally plots the results.

Usage

SumSLCClasses(gd, plot.box = TRUE, silent = FALSE, ...)

Arguments

gd

Data frame containing columns with SLC fractions, typically a 'GeoData.txt' file imported with ReadGeoData.

plot.box

Logical, if TRUE, a box plot of SLC area sums is returned.

silent

Logical, if set to TRUE, the default printing of a result summary is suppressed.

...

Other arguments to be passed to boxplot.

Details

SumSLCClasses is a wrapper for colSums with a boxplot output option, and allows to quickly control if SLCs of all SUBIDs in a GeoData data frame sum up to 1.

Value

SumSLCClasses returns a vector of SLC sums, invisibly if plot.box is TRUE.

Examples

te <- ReadGeoData(filename = system.file("demo_model", "GeoData.txt", package = "HYPEtools"))
SumSLCClasses(gd = te, plot.box = TRUE)
SumSLCClasses(gd = te, plot.box = FALSE)



rcapell/RHYPE documentation built on Feb. 28, 2024, 3:11 p.m.