Skip to content
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

Enhance the extract_body() function by adding inclusion options #1889

Merged
merged 19 commits into from
Sep 28, 2024

Conversation

rich-iannone
Copy link
Member

This update of the extract_body() function includes two new arguments: incl_hidden_cols and incl_stub_cols. Previously, the function always returned a data frame that contained hidden columns. And, though stub columns were included, there was no way to exclude them from the returned data frame.

Fixes: #1875

@olivroy
Copy link
Collaborator

olivroy commented Sep 25, 2024

I agree with the changes! Maybe it would be worth adding ... + rlang::check_dots_empty() to put output as last argument and force naming the argument explicitly to minimize breaking changes in the future.

Since this is technically a breaking change, it is worth adding to news.

gt_tbl <- gt(exibble)
# before this PR, this would work.
extract_body(gt_tbl, "unfmt_included", "html")

R/extract.R Show resolved Hide resolved
R/extract.R Show resolved Hide resolved
R/extract.R Show resolved Hide resolved
rich-iannone and others added 4 commits September 25, 2024 10:47
Co-authored-by: olivroy <52606734+olivroy@users.noreply.github.com>
Co-authored-by: olivroy <52606734+olivroy@users.noreply.github.com>
Co-authored-by: olivroy <52606734+olivroy@users.noreply.github.com>
@rich-iannone
Copy link
Member Author

Thanks for the review! I'll add a note to NEWS describing the breaking changes here. Also, before finishing this up, I'll add 1-2 examples since there aren't any right now.

@rich-iannone rich-iannone merged commit f9626de into master Sep 28, 2024
12 checks passed
@rich-iannone rich-iannone deleted the extract-body-enhance branch September 28, 2024 21:19
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.

The extract_body() function extracts a df with stub and hidden columns
2 participants