Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork996
Open
Description
This is something I noticed while looking at output on a blog post:https://tidyverse.org/blog/2025/11/two-new-tidymodels-packages/#important
Reproducible with
---title:"testing"output:html_document:keep_md:true---```{r}library(tidymodels)library(filtro)set.seed(1)yield_split <- initial_split(modeldata::chem_proc_yield)yield_splityield_train <- training(yield_split)yield_test <- testing(yield_split)``````{r}library(important)library(desirability2)goals <- desirability( maximize(cor_spearman, low = 0.25, high = 1), maximize(imp_rf_oblique, scale = 2) )yield_rec <- recipe(yield ~ ., data = yield_train) |> step_impute_knn(all_predictors(), neighbors = 10) |> step_predictor_desirability( all_predictors(), score = goals, prop_terms = 1 / 10 )yield_rec```
Looking atrecipes:::print.recipe(), it is usingcli only
https://github.com/tidymodels/recipes/blob/810b5b55b912dcae8c57f6d0a8d4db75ca88f7cd/R/recipe.R#L875-L927
So we can reproduce using something like below
---title:"testing"output:html_document:keep_md:true---```{r}print_cli <- function() { cli::cli_div(theme = list(.pkg = list(`vec-trunc` = Inf, `vec-last` = ", "))) cli::cli_h1("Recipe") cli::cli_h3("Inputs") cli::cli_text("Number of variables by role") tab <- c("X", "Y") values <- 1:2 cli::cli_verbatim(glue::glue("{names(tab)}: {values}")) cli::cli_end()}print_cli()```

This is because we have this intermediate md
---title:"testing"output:html_document:keep_md:true---```rprint_cli<-function() {cli::cli_div(theme=list(.pkg=list(`vec-trunc`=Inf,`vec-last`=",")))cli::cli_h1("Recipe")cli::cli_h3("Inputs")cli::cli_text("Number of variables by role")tab<- c("X","Y")values<-1:2cli::cli_verbatim(glue::glue("{names(tab)}: {values}"))cli::cli_end()}print_cli()``````##``````## ── Recipe ──────────────────────────────────────────────────────────────────────``````##``````## ── Inputs``````## Number of variables by role``````##```
Is this something we should try to improve inknitr orrmarkdown ? Or is this something related tocli usage ?
I'll look intocli logic to be sure, but maybe you gave ideas@yihui
Metadata
Metadata
Assignees
Labels
No labels