Learn R Programming

parsnip (version 1.0.0)

req_pkgs: Determine required packages for a model

Description

[Deprecated]

Usage

req_pkgs(x, ...)

# S3 method for model_spec req_pkgs(x, ...)

# S3 method for model_fit req_pkgs(x, ...)

Value

A character string of package names (if any).

Arguments

x

A model specification or fit.

...

Not used.

Details

For a model specification, the engine must be set. The list produced by req_pkgs()does not include the parsnip package while required_pkgs() does.

Examples

Run this code
should_fail <- try(req_pkgs(linear_reg()), silent = TRUE)
should_fail

linear_reg() %>%
  set_engine("glmnet") %>%
  req_pkgs()

linear_reg() %>%
  set_engine("lm") %>%
  fit(mpg ~ ., data = mtcars) %>%
  req_pkgs()

Run the code above in your browser using DataLab