Skip to content

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

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

Merged
merged 5 commits into from
Aug 16, 2024

Conversation

olivroy
Copy link
Collaborator

@olivroy olivroy commented Aug 15, 2024

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
Copy link
Member

@rich-iannone rich-iannone left a comment

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
11 checks passed
@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