Plot a tidal object to view the response variable observations, predictions, and normalized results separately for each month.
fitmoplot(dat_in, ...)
# S3 method for tidal
fitmoplot(
dat_in,
month = c(1:12),
tau = NULL,
predicted = TRUE,
logspace = TRUE,
dt_rng = NULL,
ncol = NULL,
col_vec = NULL,
grids = TRUE,
pretty = TRUE,
lwd = 1,
size = 2,
alpha = 1,
...
)
# S3 method for tidalmean
fitmoplot(
dat_in,
month = c(1:12),
predicted = TRUE,
logspace = TRUE,
dt_rng = NULL,
ncol = NULL,
col_vec = NULL,
grids = TRUE,
pretty = TRUE,
lwd = 1,
size = 2,
alpha = 1,
...
)
input tidal or tidalmean object
arguments passed to other methods
numeric indicating months to plot
numeric vector of quantiles to plot, defaults to all in object if not supplied
logical indicating if standard predicted values are plotted, default TRUE
, otherwise normalized predictions are plotted
logical indicating if plots are in log space
Optional chr string indicating the date range of the plot. Must be two values in the format 'YYYY-mm-dd' which is passed to as.Date
.
numeric argument passed to facet_wrap
indicating number of facet columns
chr string of plot colors to use, passed to gradcols
. Any color palette from RColorBrewer can be used as a named input. Palettes from grDevices must be supplied as the returned string of colors for each palette.
logical indicating if grid lines are present
logical indicating if my subjective idea of plot aesthetics is applied, otherwise the ggplot
default themes are used
numeric value indicating width of lines
numeric value indicating size of points
numeric value indicating transparency of points or lines
A ggplot
object that can be further modified
The plots are similar to those produced by fitplot
except the values are faceted by month. This allows an evaluation of trends over time independent of seasonal variation. Multiple observations within each month for each year are averaged for a smoother plot.
## load a fitted tidal object
data(tidfit)
# plot using defaults
fitmoplot(tidfit)
if (FALSE) {
# get the same plot but use default ggplot settings
fitmoplot(tidfit, pretty = FALSE)
# plot specific quantiles
fitmoplot(tidfit, tau = c(0.1, 0.9))
# plot the normalized predictions
fitmoplot(tidfit, predicted = FALSE)
# modify the plot as needed using ggplot scales, etc.
library(ggplot2)
fitmoplot(tidfit, pretty = FALSE, linetype = 'dashed') +
theme_classic() +
scale_y_continuous(
'Chlorophyll',
limits = c(0, 5)
) +
scale_colour_manual(
'Predictions',
labels = c('lo', 'md', 'hi'),
values = c('red', 'green', 'blue'),
guide = guide_legend(reverse = TRUE)
)
# plot a tidalmean object
data(tidfitmean)
fitmoplot(tidfitmean)
}