Description Usage Arguments Value Author(s) See Also Examples
View source: R/basinStorageVariablesPlot.R
Creates a ggplot2 stacked area plot of specified water balance storage components. The variables plotted may include:
definition
Snow component of precipitation intercepted by the canopy
Rain component of precipitation intercepted by the canopy mm or kg m-2 of water AVG
Snow water equivalent (SWE) of the snow mass
Depth of water ponded at the surface
Water equivalent of the volumetric liquid water content of the soil
Water equivalent of the volumetric frozen water content of the soil
Water equivalent of the volumetric liquid and frozen water contents of the soil, sum of LQWS and FZWS
1 2 3 4 5 | basinStorageVariablesPlot(
basinWaterBalance,
varNames = "",
layers = c(1, 2, 3, 4, 5, 6)
)
|
basinWaterBalance |
Required. Data frame to be plotted. As read in by |
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. |
Returns a ggplot2 stacked area time plot of the variable values (mm).
Kevin Shook
read_MESH_OutputTimeseries_csv
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.