Plot posterior smooths
Plot posterior smooths
## S3 method for class 'smooth_samples' draw( object, select = NULL, xlab = NULL, ylab = NULL, title = NULL, subtitle = NULL, caption = NULL, alpha = 1, colour = "black", scales = c("free", "fixed"), rug = TRUE, partial_match = FALSE, ncol = NULL, nrow = NULL, guides = "keep", ... )
object |
a fitted GAM, the result of a call to |
select |
character, logical, or numeric; which smooths to plot. If
|
xlab |
character or expression; the label for the x axis. If not
supplied, a suitable label will be generated from |
ylab |
character or expression; the label for the y axis. If not
supplied, a suitable label will be generated from |
title |
character or expression; the title for the plot. See
|
subtitle |
character or expression; the subtitle for the plot. See
|
caption |
character or expression; the plot caption. See
|
alpha |
numeric; alpha transparency for confidence or simultaneous interval. |
colour |
The colour to use to draw the posterior smooths. Passed to
|
scales |
character; should all univariate smooths be plotted with the
same y-axis scale? The default, |
rug |
logical; draw a rug plot at the botom of each plot? |
partial_match |
logical; should smooths be selected by partial matches
with |
ncol |
numeric; the numbers of rows and columns over which to spread the plots |
nrow |
numeric; the numbers of rows and columns over which to spread the plots |
guides |
character; one of |
... |
arguments to be passed to |
Gavin L. Simpson
load_mgcv() dat1 <- gamSim(1, n = 400, dist = "normal", scale = 2, verbose = FALSE) ## a single smooth GAM m1 <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat1, method = "REML") ## posterior smooths from m1 sm1 <- smooth_samples(m1, n = 15, seed = 23478) ## plot draw(sm1, alpha = 0.7) dat2 <- gamSim(4, verbose = FALSE) ## a multi-smooth GAM with a factor-by smooth m2 <- gam(y ~ fac + s(x2, by = fac) + s(x0), data = dat2, method = "REML") ## posterior smooths from m1 sm2 <- smooth_samples(m2, n = 15, seed = 23478) ## plot, this time selecting only the factor-by smooth draw(sm2, select = "s(x2)", partial_match = TRUE, alpha = 0.7)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.