Skip to content

Re export where(), any_of(), all_of() + error early for absent footnote.#1830

Merged
rich-iannone merged 5 commits into
rstudio:masterfrom
olivroy:re-export
Aug 16, 2024
Merged

Re export where(), any_of(), all_of() + error early for absent footnote.#1830
rich-iannone merged 5 commits into
rstudio:masterfrom
olivroy:re-export

Conversation

@olivroy

@olivroy olivroy commented Aug 15, 2024

Copy link
Copy Markdown
Collaborator

Summary

The rationale for the footnote change is the following:

# Before
exibble %>% gt() %>% cols_hide(num) %>% tab_footnote(locations = cells_column_labels())
#> Error in `fun(..., .envir = .envir)`:
#> ! Could not evaluate cli `{}` expression: `footnote`.
#> Caused by error in `eval(expr, envir = envir)`:
#> ! l'argument "footnote" est manquant, avec aucune valeur par défaut

# This PR
exibble %>% gt() %>% cols_hide(num) %>% tab_footnote(locations = cells_column_labels())
#> Error in `tab_footnote()`:
#> ! `footnote` is absent but must be supplied.

The idea behind re-exporting tidyselect::where() is to facilitate making summary rows work out of the box.

For example, this will work without loading the tidyverse.

library(gt)
exibble |> gt() |> grand_summary_rows(columns = where(is.numeric), fns = "sum")

Checklist

@olivroy olivroy requested a review from rich-iannone August 15, 2024 13:21

@rich-iannone rich-iannone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rich-iannone rich-iannone merged commit 6b63c32 into rstudio:master Aug 16, 2024
@olivroy olivroy deleted the re-export branch August 26, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants