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

Prompt install for missing probably package? #523

Open
hfrick opened this issue Oct 30, 2024 · 1 comment
Open

Prompt install for missing probably package? #523

hfrick opened this issue Oct 30, 2024 · 1 comment
Labels
upkeep maintenance, infrastructure, and similar

Comments

@hfrick
Copy link
Member

hfrick commented Oct 30, 2024

as_factor_from_class_pred() uses rlang::is_installed() and errors if probably is not installed. Is there a particular reason that it doesn't also prompt to install probably when used interactively, with rlang::check_installed()?

yardstick/R/misc.R

Lines 73 to 87 in 2b0c096

as_factor_from_class_pred <- function(x, call) {
if (!is_class_pred(x)) {
return(x)
}
if (!is_installed("probably")) {
cli::cli_abort(
"A {.cls class_pred} input was detected, but the {.pkg probably}
package isn't installed. Install {.pkg probably} to be able to convert
{.cls class_pred} to {.cls factor}.",
call = call
)
}
probably::as.factor(x)
}

@EmilHvitfeldt
Copy link
Member

I don't think so, it would be nice to do!

@EmilHvitfeldt EmilHvitfeldt added the upkeep maintenance, infrastructure, and similar label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

No branches or pull requests

2 participants