draw.derivatives | R Documentation |
Plot derivatives of smooths
## S3 method for class 'derivatives' draw( object, select = NULL, scales = c("free", "fixed"), alpha = 0.2, ncol = NULL, nrow = NULL, guides = "keep", angle = NULL, ... ) ## S3 method for class 'partial_derivatives' draw( object, select = NULL, scales = c("free", "fixed"), alpha = 0.2, ncol = NULL, nrow = NULL, guides = "keep", angle = NULL, ... )
object |
a fitted GAM, the result of a call to |
select |
character, logical, or numeric; which smooths to plot. If
|
scales |
character; should all univariate smooths be plotted with the
same y-axis scale? If Currently does not affect the y-axis scale of plots of the parametric terms. |
alpha |
numeric; alpha transparency for confidence or simultaneous interval. |
ncol, nrow |
numeric; the numbers of rows and columns over which to spread the plots |
guides |
character; one of |
angle |
numeric; the angle at which the x axis tick labels are to be
drawn passed to the |
... |
additional arguments passed to |
load_mgcv() dat <- data_sim("eg1", n = 800, dist = "normal", scale = 2, seed = 42) mod <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat, method = "REML") ## first derivative of all smooths df <- derivatives(mod, type = "central") draw(df) ## fixed axis scales draw(df, scales = "fixed")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.