seasyrplot | R Documentation |
Plot seasonal model response by years on a common axis
seasyrplot(dat_in, ...)
## S3 method for class 'tidal'
seasyrplot(
dat_in,
years = NULL,
tau = NULL,
predicted = TRUE,
logspace = TRUE,
col_vec = NULL,
grids = TRUE,
pretty = TRUE,
lwd = 0.5,
alpha = 1,
...
)
## S3 method for class 'tidalmean'
seasyrplot(
dat_in,
years = NULL,
tau = NULL,
predicted = TRUE,
logspace = TRUE,
col_vec = NULL,
grids = TRUE,
pretty = TRUE,
lwd = 0.5,
alpha = 1,
...
)
dat_in |
input tidal or tidalmean object |
... |
arguments passed to other methods |
years |
numeric vector of years to plot |
tau |
numeric vector of quantiles to plot, defaults to all in object if not supplied |
predicted |
logical indicating if standard predicted values are plotted, default |
logspace |
logical indicating if plots are in log space |
col_vec |
chr string of plot colors to use, passed to |
grids |
logical indicating if grid lines are present |
pretty |
logical indicating if my subjective idea of plot aesthetics is applied, otherwise the |
lwd |
numeric value indicating width of lines |
alpha |
numeric value indicating transparency of points or lines |
The plot is similar to that produced by seasplot
except the model estimates are plotted for each year as connected lines, as compared to loess lines fit to the model results. seasyrplot
is also similar to sliceplot
except the x-axis and legend grouping variable are flipped. This is useful for evaluating between-year differences in seasonal trends.
Multiple predictions per month are averaged for a smoother plot.
Note that the year variable used for color mapping is treated as a continuous variable although it is an integer by definition.
A ggplot
object that can be further modified
seasplot
, sliceplot
## load a fitted tidal object
data(tidfit)
# plot using defaults
seasyrplot(tidfit)
# get the same plot but use default ggplot settings
seasyrplot(tidfit, pretty = FALSE)
# plot specific quantiles
seasyrplot(tidfit, tau = c(0.9))
# plot the normalized predictions
seasyrplot(tidfit, predicted = FALSE)
# modify the plot as needed using ggplot scales, etc.
library(ggplot2)
seasyrplot(tidfit, pretty = FALSE, linetype = 'dashed') +
theme_classic() +
scale_y_continuous(
'Chlorophyll',
limits = c(0, 5)
)
# plot a tidalmean object
data(tidfitmean)
seasyrplot(tidfitmean)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.