show_mettrndseason {wqtrends} | R Documentation |
Plot seasonal metrics and rates of change
Description
Plot seasonal metrics and rates of change
Usage
show_mettrndseason(
mod,
metfun = mean,
doystr = 1,
doyend = 364,
justify = c("center", "left", "right"),
win = 5,
nsim = 10000,
useave = FALSE,
yromit = NULL,
ylab,
width = 0.9,
size = 3,
nms = NULL,
cols = NULL,
cmbn = F,
base_size = 11,
xlim = NULL,
ylim = NULL,
...
)
Arguments
mod |
input model object as returned by |
metfun |
function input for metric to calculate, e.g., |
doystr |
numeric indicating start Julian day for extracting averages |
doyend |
numeric indicating ending Julian day for extracting averages |
justify |
chr string indicating the justification for the trend window |
win |
numeric indicating number of years to use for the trend window, see details |
nsim |
numeric indicating number of random draws for simulating uncertainty |
useave |
logical indicating if |
yromit |
optional numeric vector for years to omit from the plot, see details |
ylab |
chr string for y-axis label |
width |
numeric for width of error bars |
size |
numeric for point size |
nms |
optional character vector for trend names, see details |
cols |
optional character vector for point colors, see details |
cmbn |
logical indicating if the no trend and on estimate colors should be combined, see details |
base_size |
numeric indicating base font size, passed to |
xlim |
optional numeric vector of length two for x-axis limits |
ylim |
optional numeric vector of length two for y-axis limits |
... |
additional arguments passed to |
Details
The plot is the same as that returned by show_metseason
with the addition of points for the seasonal metrics colored by the trends estimated from anlz_trndseason
for the specified window and justification.
Four colors are used to define increasing, decreasing, no trend, or no estimate (i.e., too few points for the window). The names and the colors can be changed using the nms
and cols
arguments, respectively. The cmbn
argument can be used to combine the no trend and no estimate colors into one color and label. Although this may be desired for aesthetic reasons, the colors and labels may be misleading with the default names since no trend is shown for points where no estimates were made.
Value
A ggplot
object
Examples
library(dplyr)
# data to model
tomod <- rawdat %>%
filter(station %in% 34) %>%
filter(param %in% 'chl') %>%
filter(yr > 2015)
mod <- anlz_gam(tomod, trans = 'log10')
show_mettrndseason(mod, metfun = mean, doystr = 90, doyend = 180, justify = 'center',
win = 4, ylab = 'Chlorophyll-a (ug/L)')