plot_rate_change: Plot rate of change

Description Usage Arguments Value

View source: R/plot_rate_change.R

Description

Given a data frame with lake levels for a single lake or multiple lakes, plot the typical rate of change over a given time interval. If data frame has multiple lakes, will display as facet plots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
plot_rate_change(
  df,
  lag_months = c(1, 3, 12),
  convert_to_ft = TRUE,
  show_zero = TRUE,
  show_median = TRUE,
  show_labels = TRUE,
  max_rate = NULL,
  title = "",
  text_size = 12,
  vline_color = "#c00000",
  hist_color = "grey80",
  density_color = "#c00000",
  line_size = 1,
  lakes = c("Pleasant", "Long", "Plainfield")
)

Arguments

df

a data frame with columns for "lake", "date", "level_obs", and "level_pred" that matches desired time series to analyze

lag_months

number of months to analyze rise/fall over, defaults to 1

convert_to_ft

defaults to true to converet rates from m/time period to ft/time period

show_zero

logical defaults to TRUE to plot vertical line at median number of months.

show_median

logical defaults to TRUE to display median rise/fall rates

show_labels

logical defaults to TRUE to label median rise/fall rates (if displayed)

max_rate

default to NULL, otherwise used to set max x limits

title

string to use for title of plot, defaults to "".

text_size

size of text, defaults to 12

vline_color

color of vertical line, defaults to a red ("#c00000")

hist_color

color of histogram bins, defaults to "grey80"

density_color

color of density curve with alpha = 0.2, defaults to a red ("#c00000")

line_size

line size, defaults to 1

lakes

vector of lakes to include in plot. Defaults to c("Pleasant", "Long", "Plainfield")

Value

plot_obj, a plot with the imputed and observed lake levels.


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