multiflashlight: Create or Update a multiflashlight

View source: R/multiflashlight.R

multiflashlightR Documentation

Create or Update a multiflashlight

Description

Combines a list of flashlights to an object of class "multiflashlight" and/or updates a multiflashlight.

Usage

multiflashlight(x, ...)

## Default S3 method:
multiflashlight(x, ...)

## S3 method for class 'flashlight'
multiflashlight(x, ...)

## S3 method for class 'list'
multiflashlight(x, ...)

## S3 method for class 'multiflashlight'
multiflashlight(x, ...)

Arguments

x

An object of class "multiflashlight", "flashlight" or a list of flashlights.

...

Optional arguments in the flashlights to update, see examples.

Value

An object of class "multiflashlight" (a named list of flashlight objects).

Methods (by class)

  • multiflashlight(default): Used to create a flashlight object. No x has to be passed in this case.

  • multiflashlight(flashlight): Updates an existing flashlight object and turns into a multiflashlight.

  • multiflashlight(list): Creates (and updates) a multiflashlight from a list of flashlights.

  • multiflashlight(multiflashlight): Updates an object of class "multiflashlight".

See Also

flashlight()

Examples

fit_lm <- lm(Sepal.Length ~ ., data = iris)
fit_glm <- glm(Sepal.Length ~ ., family = Gamma(link = log), data = iris)
mod_lm <- flashlight(model = fit_lm, label = "lm")
mod_glm <- flashlight(model = fit_glm, label = "glm")
(mods <- multiflashlight(list(mod_lm, mod_glm)))

mayer79/flashlight documentation built on Feb. 13, 2024, 1:09 p.m.