Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

listLayers

Lists available layers for plotSmooth objects


Description

This function takes as input an object of class plotSmooth and returns the names of all the possible visual layers that could be used with that object.

Usage

listLayers(o)

Arguments

o

an object of class plotSmooth.

Value

A vector containing the names of the available layers.

Examples

library(mgcViz)
n  <- 400
x1 <- rnorm(n)
x2 <- rnorm(n)
dat <- data.frame("x1" = x1, "x2" = x2,
                  "y" = sin(x1) + 0.5 * x2^2 + rnorm(n))
b <- gam(y ~ x1+s(x2), data = dat, method = "REML")
b <- getViz(b)

# List layers available for parametric effect plot
o <- plot( pterm(b, 1) )
listLayers(o)

# List layers available for smooth effect plot
o <- plot( sm(b, 1) )
listLayers(o)

# List layers available for checking plot
o <- check1D(b, x1)
listLayers(o)

mgcViz

Visualisations for Generalized Additive Models

v0.1.6
GPL-3
Authors
Matteo Fasiolo [aut, cre], Raphael Nedellec [aut], Yannig Goude [ctb], Christian Capezza [ctb], Simon N. Wood [ctb]
Initial release
2020-03-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.