UpstreamSLCClasses: Calculate SLC class fractions of all upstream areas

View source: R/function_UpstreamSLCClasses.R

UpstreamSLCClassesR Documentation

Calculate SLC class fractions of all upstream areas

Description

Function to calculate SLC class fractions over all upstream areas of a vector of SUBIDs or all SUBIDs in a GeoData table.

Usage

UpstreamSLCClasses(
  subid = NULL,
  gd,
  bd = NULL,
  signif.digits = 3,
  progbar = TRUE
)

Arguments

subid

Integer vector of SUBIDs to calculate upstream SUBID fractions for (must exist in gd). If NULL, upstream areas for all SUBIDs will be calculated.

gd

A data frame containing columns 'SUBID' with SUBIDs, 'MAINDOWN' with downstream SUBIDs, and 'AREA' with sub-basin areas, e.g. an imported 'GeoData.txt' file.

bd

A data frame with bifurcation connections, e.g. an imported 'BranchData.txt' file. Optional argument.

signif.digits

Integer, number of significant digits to round upstream SLCs to. See also signif. Set to NULL to prevent rounding.

progbar

Logical, display a progress bar while calculating SLC class fractions. Adds overhead to calculation time but useful when subid is NULL or contains many SUBIDs.

Details

UpstreamSLCClasses sums upstream areas of all connected upstream SUBIDs, including branch connections in case of stream bifurcations but not including potential irrigation links or groundwater flows.

Value

UpstreamSLCClasses returns a data frame with columns containing SUBIDs, total upstream areas (in area unit as provided in gd), and SLC class fractions for upstream areas.

Note

This function is now superseded by UpstreamGeoData, which returns more upstream variables.

See Also

SumUpstreamArea, UpstreamGeoData, UpstreamGroupSLCClasses

Examples

# Import source data
te1 <- ReadGeoData(filename = system.file("demo_model", "GeoData.txt", package = "HYPEtools"))
# Upstream SLCs for single SUBID
UpstreamSLCClasses(subid = 3361, gd = te1, progbar = FALSE)


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