p_gam | R Documentation |
Generic function to print GAMs using mgcViz
p_gam(x)
x |
a GAM object created by |
a 'ggplot2' graph object of the GAM
# load necessary libraries
library("tidyverse")
library("mgcv")
library("mgcViz")
library("ChickpeaAscoDispersal")
# these data are automatically loaded
dat <- left_join(lesion_counts, summary_weather, by = c("site", "rep"))
mod1 <- gam(
m_lesions ~ s(distance, k = 5),
data = dat
)
print(p_gam(x = getViz(mod1)) +
ggtitle("s(Distance)"),
pages = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.