basinStorageVariablesPlot: Plots basin water balance storage components

Description Usage Arguments Value Author(s) See Also Examples

View source: R/basinStorageVariablesPlot.R

Description

Creates a ggplot2 stacked area plot of specified water balance storage components. The variables plotted may include:

variable

definition

SNCAN

Snow component of precipitation intercepted by the canopy

RCAN

Rain component of precipitation intercepted by the canopy mm or kg m-2 of water AVG

SNO

Snow water equivalent (SWE) of the snow mass

ZPND

Depth of water ponded at the surface

LQWS

Water equivalent of the volumetric liquid water content of the soil

FZWS

Water equivalent of the volumetric frozen water content of the soil

ALWS

Water equivalent of the volumetric liquid and frozen water contents of the soil, sum of LQWS and FZWS

Usage

1
2
3
4
5
basinStorageVariablesPlot(
  basinWaterBalance,
  varNames = "",
  layers = c(1, 2, 3, 4, 5, 6)
)

Arguments

basinWaterBalance

Required. Data frame to be plotted. As read in by read_MESH_OutputTimeseries_csv.

varNames

Optional. A vector of the names of the variables to be plotted. If not specified, all of the variables listed above will be plotted.

layers

Optional. A vector of the layers to be plotted. By default layers 1 through 6 are used.

Value

Returns a ggplot2 stacked area time plot of the variable values (mm).

Author(s)

Kevin Shook

See Also

read_MESH_OutputTimeseries_csv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
waterBalance <- read_MESH_OutputTimeseries_csv("Basin_average_water_balance.csv")
p <- basinStorageVariablesPlot(waterBalance)
# the plot can have a restricted date range
startDate <- as.Date("2005-10-01", format = "%Y-%m-%d")
endDate <- as.Date("2006-09-30", format = "%Y-%m-%d")
library(ggplot2)
p <- p + xlim(startDate, endDate)
p
# you can also change the colours used, either by
using a defined scale, or by manually specifying them
# This example uses the colours in the package viridis
# which scales from dark to light by reversing the direction
library(viridis)
p <- p +  scale_fill_viridis(discrete = TRUE, direction = -1)
p

## End(Not run)

CentreForHydrology/MESHr documentation built on Jan. 11, 2021, 8:34 p.m.