View source: R/hruGroupWaterSummary.R
hruGroupWaterSummary | R Documentation |
Calculates daily totals of water storages and fluxes for groups of HRUs, for models without sub-basins.
hruGroupWaterSummary(
dailyWater,
vars = "all",
prjFile,
HRUgroups,
basinMean,
quiet = TRUE,
logfile = ""
)
dailyWater |
Required. The output from the |
vars |
Optional. Variable column numbers to be used (not including the datetime). The default value all selects all columns. |
prjFile |
Required. The CRHM model .prj file. |
HRUgroups |
Required. This can be either a vector or list. If a vector, it contains strings used to group the selected HRU names in the .prj file. If a list, it contains vectors of the HRU numbers to be grouped. See the examples for both usages. |
basinMean |
Required. This refers to how the daily water values were
calculated by |
quiet |
Optional. Suppresses display of messages, except for errors.
The default is TRUE. If you are calling this
function in an R script, you will usually leave quiet=TRUE (i.e. the default).
If you are working interactively, you will p#' robably want to set |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If successful returns a data frame containing each variable summarized
by each HRU group. The names of the variables are in the form:
hruGroup.variable.group_total
or hruGroup.variable.basin_total
.
If unsuccessful, returns an error.
## Not run:
# First, calculate daily water values. In these examples, the water is
# in mm per HRU
#' b <- readOutputFile('Bologna1984_30y_output.txt', timezone='MST')
# get daily values without aggregation; values calculated w.r.t the HRU area
dailyHRU <- simpleDailyWater(b, prjFile = "Bologna1984_02.prj", basinMean = FALSE)
# summarize by groups of HRUs with similar names
daily_group <- hruGroupSummary(daily,
prjFile = "Bologna1984_02.prj",
HRUgroups = c("firn", "ice", "bl"), basinMean = FALSE
)
# summarize by named groups of HRUs with specified numbers
groups <- list(group1 = c(1, 2, 3), group2 = c(4, 5, 6))
daily_group <- hruGroupSummary(daily,
prjFile = "Bologna1984_02.prj",
HRUgroups = groups, basinMean = FALSE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.