Description Usage Arguments Examples
Plot a generalized additive model
1 2 3 4 5 | plot_gam(x, y, g = NULL, data, fittype = c("gam", "lm"), kgam = 4,
R = NULL, randommethod = c("gamm", "aggregate"), log = "",
axes = TRUE, fitoneline = FALSE, pointcols = NULL, linecols = NULL,
xlab = NULL, ylab = NULL, band = TRUE, bandcolor = alpha("lightgrey",
0.7), plotit = TRUE, add = FALSE, npred = 101, lwd = 2, ...)
|
x |
Variable for X axis (unquoted) |
y |
Variable for Y axis (unquoted) |
g |
Variable for grouping (unquoted); optional |
data |
Dataframe containing x and y |
kgam |
the |
R |
An optional random effect (quoted) |
randommethod |
If 'gamm', passes the random effect variable to |
log |
Whether to add log axes for x or y (but no transformations are done). |
fitoneline |
Whether to fit only one curve to the entire dataset, regardless of whether a grouping variable was defined |
pointcols |
Colours of the points, can be a vector |
linecols |
Colours of the linces, can be a vector |
xlab |
X-axis label |
ylab |
Y-axis label |
band |
Logical. If true, plots the confidence band (as a transparent polygon). |
1 2 3 4 5 6 7 8 | data(Loblolly)
plot_gam(age, height, data=Loblolly)
plot_gam(age, height, Seed, data=Loblolly, band=FALSE, linecols="black")
plot_gam(age, height, Seed, data=Loblolly, band=FALSE, linecols="black", fittype="lm")
data(ChickWeight)
library(wesanderson)
plot_gam(Time, weight, Diet, R="Chick", data=ChickWeight, linecols=wes_palette("Rushmore"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.