Skip to content

[Deprecated]

Usage

req_pkgs(x, ...)

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

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

Arguments

x

A model specification or fit.

...

Not used.

Value

A character string of package names (if any).

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

should_fail <- try(req_pkgs(linear_reg()), silent = TRUE)
#> Warning: `req_pkgs()` was deprecated in parsnip 0.1.8.
#>  Please use `required_pkgs()` instead.
should_fail
#> [1] "stats"

linear_reg() %>%
  set_engine("glmnet") %>%
  req_pkgs()
#> [1] "glmnet"

linear_reg() %>%
  set_engine("lm") %>%
  fit(mpg ~ ., data = mtcars) %>%
  req_pkgs()
#> [1] "stats"