Skip to content

Prompt install for missing probably package? #523

@hfrick

Description

@hfrick

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    tidy-dev-day 🤓Tidyverse Developer Day rstd.io/tidy-dev-dayupkeepmaintenance, infrastructure, and similar

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions