p_gam: Generic function to print GAMs using mgcViz

View source: R/p_gam.R

p_gamR Documentation

Generic function to print GAMs using mgcViz

Description

Generic function to print GAMs using mgcViz

Usage

p_gam(x)

Arguments

x

a GAM object created by gam

Value

a 'ggplot2' graph object of the GAM

Examples

# 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)
      

adamhsparks/ChickpeaAscoDispersal documentation built on Jan. 11, 2023, 1:20 p.m.