Learn R Programming

visreg (version 3.0.0)

visreg_list: Join multiple visreg objects together in a list

Description

This function takes multiple visreg objects, from separate calls to visreg(), and joins them together in a single object. The single object will be of type visreg_list unless collapse=TRUE is specified, in which case the list will be collapsed back down into a single visreg object.

Usage

visreg_list(..., labels, collapse = FALSE)

Value

A visreg or visreg_list object, depending on the value of collapse.

Arguments

...

visreg objects, as produced by calls to visreg().

labels

A character vector with length corresponding to the number of visreg objects passed to the function that provides labels for the different objects in subsequent plots. Only has an effect if collapse=TRUE.

collapse

If TRUE, the resulting object will be collapsed down into a single visreg object. If FALSE, the resulting object will be a visreg_list.

See Also

visreg(), plot.visreg()

Examples

Run this code
fit <- lm(Ozone ~ Solar.R + Wind + Temp, data = airquality)
v1 <- visreg(fit, "Wind", plot = FALSE, alpha = 0.2)
v2 <- visreg(fit, "Wind", plot = FALSE, alpha = 0.01)
vv1 <- visreg_list(v1, v2, collapse = FALSE)
vv2 <- visreg_list(v1, v2,
  collapse = TRUE,
  labels = c("Confidence: 0.80", "Confidence: 0.99")
)
plot(vv1)
plot(vv2)

Run the code above in your browser using DataLab