gridplot | R Documentation |
Plot the relationship between the response variable and salinity/flow across the time series using a gridded surface for all months. The response is shaded by relative values across all dates for comparison.
gridplot(dat_in, ...)
## S3 method for class 'tidal'
gridplot(
dat_in,
month = c(1:12),
tau = NULL,
years = NULL,
col_vec = NULL,
col_lim = NULL,
logspace = TRUE,
floscl = TRUE,
allflo = FALSE,
flo_fac = 3,
yr_fac = 3,
ncol = NULL,
grids = FALSE,
pretty = TRUE,
...
)
## S3 method for class 'tidalmean'
gridplot(
dat_in,
month = c(1:12),
years = NULL,
col_vec = NULL,
col_lim = NULL,
logspace = TRUE,
floscl = TRUE,
allflo = FALSE,
flo_fac = 3,
yr_fac = 3,
ncol = NULL,
grids = FALSE,
pretty = TRUE,
...
)
dat_in |
input tidal or tidalmean object |
... |
arguments passed to other methods |
month |
numeric indicating months to plot or chr string 'all' to indicate all months with no plot facets |
tau |
numeric vector of quantile to plot. The function will plot the 'middle' quantile if none is specified, e.g., if 0.2, 0.3, and 0.4 are present in the fitted model object then 0.3 will be plotted. |
years |
numeric vector for range of years to plot |
col_vec |
chr string of plot colors to use, passed to |
col_lim |
numeric vector of length two that defines the range of the color ramp in the legend, passed to |
logspace |
logical indicating if plots are in log space |
floscl |
logical indicating if salinity/flow on x-axis is standardized (default) or in original scale |
allflo |
logical indicating if the salinity/flow values for plotting are limited to the fifth and ninety-fifth percentile of observed values for the month of interest |
flo_fac |
numeric value indicating the factor for smoothing the response variable across salinity/flow values. Increasing the value creates more smoothing and setting the value to 1 removes all smoothing. |
yr_fac |
numeric value indicating the factor for smoothing the response variable across integer years. Increasing the value creates more smoothing and setting the value to 1 removes all smoothing. |
ncol |
numeric argument passed to |
grids |
logical indicating if grid lines are present |
pretty |
logical indicating if my subjective idea of plot aesthetics is applied, otherwise the |
These plots can be used to examine how the relationship between the response variable and salinity/flow varies throughout the time series for multiple months. The plot is similar to that returned by dynaplot
except changes in the response are shown on a gridded surface of salinity/flow versus time. Multiple months can also be viewed. Color shading is in proportion to the value of the response variable and is relative across the plotted months. The interpolation grid that is stored as an attribute in a fitted tidal object is used to create the plot. By default, the plots are constrained to the fifth and ninety-fifth percentile of observed salinity/flow values during each month to limit the predictions within the data domain. This behavior can be suppressed by changing the allflo
argument, although the predicted values of the response variable that are outside of the salinity/flow range for the plotted month are typically unrealistic.
A ggplot
object that can be further modified
dynaplot
, fitplot
, gridplot
, prdnrmplot
## Not run:
## load a fitted tidal object
data(tidfit)
## defaults to the fiftieth quantile
gridplot(tidfit)
## no facets, all months
gridplot(tidfit, month = 'all')
## change the defaults
gridplot(tidfit, tau = c(0.1), month = c(3, 6, 9, 12),
col_vec = c('red', 'blue', 'green'), flo_fac = 1)
## plot a tidalmean object
data(tidfitmean)
gridplot(tidfitmean)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.