Skip to content

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

Merged
rich-iannone merged 19 commits into
masterfrom
extract-body-enhance
Sep 28, 2024
Merged

Enhance the extract_body() function by adding inclusion options#1889
rich-iannone merged 19 commits into
masterfrom
extract-body-enhance

Conversation

@rich-iannone
Copy link
Copy Markdown
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
Copy Markdown
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")

Comment thread R/extract.R
Comment thread R/extract.R
Comment thread R/extract.R
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
Copy Markdown
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
@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