tidymodels / themis

Extra recipes steps for dealing with unbalanced data

Home Page:https://themis.tidymodels.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update to use print_step() instead of printer() in print methods

EmilHvitfeldt opened this issue Β· comments

Hello πŸ‘‹

In the most recent CRAN release of {recipes}, we took the first step towards updating the printing infrastructure to use {cli}. This means that in order for your steps to print properly when the next version of {recipes} gets on CRAN, you will need to have adopted this change as well. Failure to do so won't result in errors, only malformed printing. The change itself is fairly minimal. Please see the following PR tidymodels/recipes#871 for examples of how this change is to be done. Please let me know if you have any questions!

See example below:

# Old
print.step_pls <- function(x, width = max(20, options()$width - 35), ...) {
  cat("PLS feature extraction with ")
  printer(x$columns, x$terms, x$trained, width = width)
  invisible(x)
}

# New
print.step_pls <- function(x, width = max(20, options()$width - 35), ...) {
  title <- "PLS feature extraction with "
  print_step(x$columns, x$terms, x$trained, width = width, title = title)
  invisible(x)
}

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.