plot.wateres_series: Plot of reservoir time series

View source: R/plots.R

plot.wateres_seriesR Documentation

Plot of reservoir time series

Description

Plots time series of chosen water balance variables for the reservoir, by using the ggplot2 package.

Usage

## S3 method for class 'wateres_series'
plot(x, reser, type = "flow", begin = 1,
  end = nrow(x), filename = NULL, width = 8, height = 6, ...)

Arguments

x

A wateres_series object with reservoir variables as returned by calc_series.wateres.

reser

A corresponding wateres object whose series of number of minutes will be used.

type

A type of variables to be plotted: “storage”, “level” or “flow” which plots all of the remaining variables.

begin

A time step to begin the plot.

end

A time step to end the plot.

filename

A file name where the plot will be saved. If not specified, the plot will be printed to the current device.

width

Plot width in inches (or a unit specified by the units argument).

height

Plot height in inches (or a unit specified by the units argument).

...

Further arguments passed to the ggsave function saving the plot to a file.

Details

Series of flows with all values equal to zero are ignored.

An error occurs if length of the time series of results (x) does not equal to the length of the reservoir data (reser).

Value

A ggplot object.

See Also

calc_series.wateres used for calculation of reservoir time series

Examples

reser = data.frame(
    Q = c(0.078, 0.065, 0.168, 0.711, 0.154, 0.107, 0.068, 0.057, 0.07, 0.485, 0.252, 0.236,
          0.498, 0.248, 0.547, 0.197, 0.283, 0.191, 0.104, 0.067, 0.046, 0.161, 0.16, 0.094),
    DTM = seq(as.Date("2000-01-01"), by = "months", length.out = 24))
reser = as.wateres(reser, storage = 14.4e6, area = 754e3)
plot(calc_series(reser, 14.4e6, 0.14), reser)

tgmwri/wateres documentation built on Feb. 13, 2024, 10:25 p.m.