Skip to content

Add tests for cols_units() and fix edge case + improve error messages for cells_grand_summary() #1733

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 7 commits into from
Jun 26, 2024

Conversation

olivroy
Copy link
Collaborator

@olivroy olivroy commented Jun 26, 2024

Summary

Since it could detect the end of the string in unit, this would fail

library(gt)
d <- data.frame(col1 = 1, col2 = 2)
d |> gt() |> cols_units(everything() ~ "1")
#> Error in if (column_pattern == "" && grepl(units, column_label, fixed = TRUE)) { : 
#>   missing value where TRUE/FALSE needed

due to the fact that the gsub part is TRUE.

Let me know if you want me to buildignore the cols_units() tests.

As always, this occured randomly to me. None of this is related to what I intended to do in the first place, but caught previous mistakes (made by me) and some unfound stuff!

Related GitHub Issues and PRs

Also improve some messages and add some basic checking of input.

Checklist

@olivroy olivroy changed the title Add tests for cols_units() and fix edge case. Add tests for cols_units() and fix edge case + improve error messages for cells_grand_summary() Jun 26, 2024
@rich-iannone rich-iannone self-requested a review June 26, 2024 22:28
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 c3ea788 into rstudio:master Jun 26, 2024
12 checks passed
@olivroy olivroy deleted the cols-units-tests branch June 26, 2024 22:36
@olivroy
Copy link
Collaborator Author

olivroy commented Jun 26, 2024

@rich-iannone is it possible to have a gt group and display tables side-by-side? I couldn't find much examples of gt_group()

@rich-iannone
Copy link
Member

@olivroy There's nothing built in to make this possible, though it seems like would be a really nice feature down the road.

@rich-iannone
Copy link
Member

@olivroy We should do exactly this: #1288

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