plot.wateres_prob_field: Plot of probability field

View source: R/plots.R

plot.wateres_prob_fieldR Documentation

Plot of probability field

Description

Plots monthly values of storage, yield or level stored in a given wateres_prob_field object, by using the ggplot2 package.

Usage

## S3 method for class 'wateres_prob_field'
plot(x, type = "storage", filename = NULL,
  width = 8, height = 6, ...)

Arguments

x

A wateres_prob_field object.

type

Type of values to be plotted (“storage”, “yield” or “level”).

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

An error occurs if levels are required but they are not contained in the wateres_prob_field object.

Value

A ggplot object.

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)
prob_field = prob_field(reser, c(0.9, 0.95, 0.99), 0.14)
plot(prob_field, "storage")

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