Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create informative error message if a model engine package is not installed #292

Closed
markbneal opened this issue Apr 30, 2020 · 2 comments · Fixed by #293
Closed

Create informative error message if a model engine package is not installed #292

markbneal opened this issue Apr 30, 2020 · 2 comments · Fixed by #293

Comments

@markbneal
Copy link

Following the example at https://rviews.rstudio.com/2019/06/19/a-gentle-intro-to-tidymodels/, running a model generates uninformative errors if the engine is not installed:

 iris_ranger <- rand_forest(trees = 100, mode = "classification") %>%
  set_engine("ranger") %>%
  fit(Species ~ ., data = iris_training)

If ranger not installed:

# Error in parse(text = text, keep.source = FALSE) : 
#   <text>:5:5: unexpected 'else'
# 4:     }
# 5:     else
#   ^

and for:

iris_rf <-  rand_forest(trees = 100, mode = "classification") %>%
  set_engine("randomForest") %>%
  fit(Species ~ ., data = iris_training)

If randomForest not installed:

# Error in as.data.frame.default(x) : 
#   cannot coerce class ‘c("rand_forest", "model_spec")’ to a data.frame
@topepo topepo transferred this issue from tidymodels/tidymodels Apr 30, 2020
@juliasilge
Copy link
Member

Related to #289

topepo added a commit that referenced this issue Apr 30, 2020
@github-actions
Copy link

github-actions bot commented Mar 7, 2021

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants