tidymodels / hardhat

Construct Modeling Packages
https://hardhat.tidymodels.org
Other
103 stars 17 forks source link

`validate_outcomes_is_factor()` #90

Closed DavisVaughan closed 5 years ago

DavisVaughan commented 5 years ago

Currently can provide an easy implementation that can be replaced with #84

validate_outcomes_is_factor <- function(outcomes) {
  is_factor <- vapply(outcomes, is.factor, FUN.VALUE = logical(1))
  if (!all(is_factor)) {
    rlang::abort(paste0("The outcome must be a factor."))
  }
}
github-actions[bot] commented 3 years ago

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.