Description Usage Arguments Value
Given a data frame with lake levels for a single lake or multiple lakes, plot the estimated and observed lake levels. If data frame has multiple lakes, will display as facet plots. Options to add yintercepts. Also option to add second axis with lake depth, if only plotting one lake.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | plot_levels(
df,
lakes = c("Pleasant", "Long", "Plainfield"),
yintercept = NULL,
probs = NULL,
all_probs = FALSE,
title = "",
legend_pos = c(0.1, 0.95),
show_obs_type = FALSE,
text_size = 12,
color_vals = c("grey70", "black"),
hline_color = "#c00000",
line_size = 1,
point_size = 3,
npretty_breaks = NULL,
force_range = TRUE,
force_pfl = TRUE,
convert_units = "",
grid_off = TRUE,
show_uncertainty = FALSE,
show_exceeds = NULL,
ncol = 1
)
|
df |
a data frame with columns for "lake", "date", "level_obs", and "level". |
lakes |
vector of lakes to include in plot. Defaults to c("Pleasant", "Long", "Plainfield") |
yintercept |
either a single value (if only one lake) or a data frame with two columns: "yintercept" with the values, and "lake" with the name of each lake in df. Default to NULL to not add a line. |
probs |
exceedance probability (e.g., 10 for 10%) to identify with a horizontal line |
all_probs |
logical defaults to FALSE. If true, adds rectangle representing 10-90 percentiles with solid line at 50th percentile. |
title |
string to use for title of plot, defaults to "". |
legend_pos |
position of legend. Defaults to c(0.15, 0.95) but can also be "top", "right", etc. |
show_obs_type |
logical defaults to FALSE to show observations as black points. If TRUE, uses different colors and shapes to indicate different types of observations. If true, suggest setting color_vals to c("grey70", "#1B9E77", "#7570B3", "#D95F02"). |
text_size |
size of text, defaults to 12 |
color_vals |
colors to use for line and points, defaults to c("grey70", "black") for grey lines, black points |
hline_color |
color of horizontal line, if present. Defaults to a red. |
line_size |
line size, defaults to 1 |
point_size |
point size, defaults to 3 |
npretty_breaks |
defaults to NULL, set to 3 to limit Long, Plainfield, and Pleasant to integers (or play around, may be different with different periods of record) |
force_range |
defaults to TRUE to force y-limits of all facets to have the same range. |
force_pfl |
defaults to TRUE to force the y-limits of plainfield lake to the same as long lake. |
convert_units |
logical defaults to "". If "meterTOft", converts values from meters to feet. |
grid_off |
defaults to TRUE to turn off gridlines. |
show_uncertainty |
defaults to FALSE. If TRUE, shows dark grey ribbon representing mean +/- one standard deviation and a light grey ribbon representing mean +/- two standard deviations. |
show_exceeds |
defaults to NULL. If a value (e.g., 10, 90) creates a ribbon that highlights when the lake level corresponding to the given exceedance probability is exceeded. |
ncol |
number of columns. Defaults to 1 (stacks plots vertically), but can be set to 3 to show all CSLS lakes horizontally |
plot_obj, a plot with the imputed and observed lake levels.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.