View source: R/required_pkgs.R
required_pkgs.model_spec | R Documentation |
Determine required packages for a model
## S3 method for class 'model_spec'
required_pkgs(x, infra = TRUE, ...)
## S3 method for class 'model_fit'
required_pkgs(x, infra = TRUE, ...)
x |
A model specification or fit. |
infra |
Should parsnip itself be included in the result? |
... |
Not used. |
A character vector
should_fail <- try(required_pkgs(linear_reg(engine = NULL)), silent = TRUE)
should_fail
linear_reg() %>%
set_engine("glmnet") %>%
required_pkgs()
linear_reg() %>%
set_engine("glmnet") %>%
required_pkgs(infra = FALSE)
linear_reg() %>%
set_engine("lm") %>%
fit(mpg ~ ., data = mtcars) %>%
required_pkgs()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.