no_plot: Suppress plotting output of plot function

Description Usage Arguments Details See Also Examples

View source: R/helper_funs.R

Description

This function suppresses plotting output of plot function

Usage

1
no_plot(model = NULL)

Arguments

model

A fitted GAM(M).

Details

To prevent unwanted plot printing of plot in a function call in which the only desire is to work with the returned information of plot. Used in plot_gam().

See Also

plot_gam()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# load data (Source: ?mgcv::gam)
library(mgcv)
n <- 200
sig <- 2
dat <- gamSim(1, n = n, scale = sig, verbose = FALSE)
dat$x4 <- as.factor(c(
  rep("A", 50), rep("B", 50), rep("C", 50),
  rep("D", 50)
))
fit_gam <- gam(y ~ s(x0) + s(I(x1^2)) + s(x2) +
  offset(x3) + x4, data = dat) # fit model

tmp <- plot(fit_gam, pages = 1) # plot output
tmp <- no_plot(fit_gam) # no plot output

Example output

Loading required package: nlme
This is mgcv 1.8-28. For overview type 'help("mgcv-package")'.

oddsratio documentation built on July 1, 2020, 10:22 p.m.