plot_nyear: Plot bias, precision, and accuracy of metrics

Description Usage Arguments

View source: R/plot_nyear.R

Description

Creates a facet plot with lakes faceted horizontally and error estimates faceted vertically.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
plot_nyear(
  df_box,
  df_point,
  df_point_short = NULL,
  metric_name,
  metric_title = "",
  variable_title = "",
  variable_breaks = "sort",
  variable_labels,
  value_title = "",
  convert_units = "",
  point_color = "#c00000",
  point_size = 2,
  text_size = 12,
  same_range = TRUE,
  ytick_precision = 0.5,
  rotate_xticks = FALSE,
  pfl_is_long = FALSE
)

Arguments

df_box

data frame with the following columns for a shortened timeseries:

  • lakename of lake, e.g., Pleasant, Long, Plainfield, Devils

  • metricname of hydrologic metrics, e.g. median_level, cv_rise_rate

  • variablename of variation on metrics, e.g. 10 for 10% exceedance level

  • simvalue from this iteration

  • nsimid of this iteration

df_point

data frame with the following columns for the entire timeseries:

  • lakename of lake, e.g., Pleasant, Long, Plainfield, Devils

  • metricname of hydrologic metrics, e.g. median_level, cv_rise_rate

  • variablename of variation on metrics, e.g. 10 for 10% exceedance level

  • value"true" value based on entire timeseries

df_point_short

optional data frame defaults to NULL, but if provided includes the lake, metric, variable, and value for a specific simulation.

metric_name

name of metric to display on this plot

metric_title

string to use for plot title, defaults to "" for no title

variable_title

string to use for color legend, defaults to "" for no title

variable_breaks

vector with values to use for variable breaks in color legend. Defaults to "sort" to convert unique options in "variable" column to numeric values and sort in ascending order.

variable_labels

vector with strings to use for variable labels in color legend. Defaults to "breaks" to indicate use same values as breaks. Can also be "percent" to add a percent symbol to values in variable_breaks.

value_title

label for y-axis values

convert_units

logical defulats to "". If "metersTOft", converts values from meters to feet.

point_color

color of points, defaults to "#c00000"

point_size

size of points, defaults to 2,

text_size

size of text on plots. Defaults to 12.

same_range

logical defaults to TRUE to indicate all subplots should have the same range in y. If FALSE

ytick_precision

indicates precision of rounding, defaults to 0.5. Only used if same_range is TRUE.

rotate_xticks

defaults to FALSE. If TRUE, rotates x tick lables 90 degrees

pfl_is_long

logical defaults to FALSE to indicate Plainfield and Long can retain independent ranges. Only used if same_range is TRUE.


WDNR-Water-Use/CSLSlevels documentation built on Nov. 21, 2020, 9:13 a.m.