SubidAttributeSummary: Summarize subbasin attributes

View source: R/function_SubidAttributeSummary.R

SubidAttributeSummaryR Documentation

Summarize subbasin attributes

Description

Prepare data frame containing summary of subbasin attributes.

Usage

SubidAttributeSummary(
  subids = NULL,
  gd,
  bd = NULL,
  gc = NULL,
  desc = NULL,
  group = NULL,
  group.upstream = TRUE,
  signif.digits = NULL,
  progbar = FALSE,
  summarize.landuse = TRUE,
  summarize.soil = TRUE,
  summarize.crop = TRUE,
  summarize.upstreamarea = TRUE,
  unweighted.gd.cols = NULL,
  upstream.gd.cols = NULL,
  olake.slc = NULL,
  bd.weight = FALSE,
  mapoutputs = NULL
)

Arguments

subids

Vector containing SUBIDs of subbasins to summarize.

gd

Imported HYPE GeoData.txt file. See ReadGeoData.

bd

Imported HYPE BranchData.txt file. See ReadBranchData.

gc

Imported HYPE GeoClass.txt file. See ReadGeoClass.

desc

Optional, Imported HYPE Description file. If provided, then dataframe columns will be renamed using the short names in the description file. See ReadDescription.

group

Optional, Integer vector of same length as number of SLC classes in gd. Alternative grouping index specification to gcl + type for UpstreamGroupSLCClasses.

group.upstream

Logical, if TRUE, then SLC fractions will be summarized for upstream areas using UpstreamGroupSLCClasses. If FALSE, then SLC fractions will be summarized for subbasin area only using GroupSLCClasses.

signif.digits

Optional, Integer specifying number of significant digits to round outputs to. Used by UpstreamGroupSLCClasses and UpstreamGeoData.

progbar

Logical, display a progress bar while calculating summary information. Used by UpstreamGroupSLCClasses and UpstreamGeoData.

summarize.landuse

Logical, specify whether or not subbasin upstream landuse fractions should be calculated.

summarize.soil

Logical, specify whether or not subbasin upstream soil fractions should be calculated.

summarize.crop

Logical, specify whether or not subbasin upstream crop fractions should be calculated.

summarize.upstreamarea

Logical, specify whether or not subbasin upstream area should be calculated.

unweighted.gd.cols

Vector, names of gd columns which should be joined to the output data frame without any additional processing.

upstream.gd.cols

Vector, specify column names of gd which should be summarized using UpstreamGeoData.

olake.slc

Integer, SLC class number representing outlet lake fractions. Used by UpstreamGeoData.

bd.weight

Logical, if set to TRUE, flow weights will be applied for areas upstream of stream bifurcations. See UpstreamGeoData.

mapoutputs

Vector, paths to mapoutput files that should be read by ReadMapOutput and joined to the output data frame.

Details

SubidAttributeSummary can be used to create a data frame object containing subbasin attribute summary information. This data frame can then be used as the attributes input for PlotPerformanceByAttribute. The function can summarize subbasin upstream landuse, soil, and crop fractions using UpstreamGroupSLCClasses. In addition, the function can summarize upstream GeoData information using UpstreamGeoData. Finally, the function can join mapoutput and GeoData columns directly to the output data frame (i.e without further processing).

Value

SubidAttributeSummary returns a data frame object containing subbasin attribute summary information.

See Also

UpstreamGroupSLCClasses, GroupSLCClasses, UpstreamGeoData, ReadMapOutput for subbasin attribute summary functions; PlotPerformanceByAttribute for related plotting function.

Examples


subass <- ReadSubass(filename = system.file("demo_model", "results",
  "subass1.txt",
  package = "HYPEtools"
), check.names = TRUE)
gd <- ReadGeoData(filename = system.file("demo_model",
  "GeoData.txt",
  package = "HYPEtools"
))
gc <- ReadGeoClass(filename = system.file("demo_model",
  "GeoClass.txt",
  package = "HYPEtools"
))

SubidAttributeSummary(subids <- subass$SUBID,
  gd = gd, gc = gc,
  mapoutputs = c(system.file("demo_model", "results", "mapCOUT.txt", package = "HYPEtools")),
  upstream.gd.cols = c("SLOPE_MEAN")
)



HYPEtools documentation built on Sept. 11, 2024, 8:34 p.m.