Skip to content

Add small collection of sub_*() functions#912

Merged
rich-iannone merged 73 commits intomasterfrom
sub-fns
May 22, 2022
Merged

Add small collection of sub_*() functions#912
rich-iannone merged 73 commits intomasterfrom
sub-fns

Conversation

@rich-iannone
Copy link
Member

The sub_*() group of functions are meant to make simple and common substitutions of data in a gt table with not-too-much effort. The functions added are:

  • sub_missing()
  • sub_zero()
  • sub_small_vals()
  • sub_large_vals()

The sub_missing() function will replace fmt_missing() (deprecating the latter function).

Fixes #904
Fixes #910
Fixes #911

@jcheng5
Copy link
Member

jcheng5 commented May 10, 2022

Note to self, advantages of sub_small_vals over fmt_replace are:

  1. No need to know about prepend = TRUE/FALSE
  2. Can apply to multiple columns in one call
  3. Can easily use fancy context-specific symbols
  4. sub_small_vals implements logic for finding small values (no need to specify row)

@rich-iannone rich-iannone marked this pull request as ready for review May 18, 2022 03:59
@jcheng5 jcheng5 self-requested a review May 20, 2022 19:52
@rich-iannone rich-iannone merged commit 7220bd2 into master May 22, 2022
@rich-iannone rich-iannone deleted the sub-fns branch May 22, 2022 20:27
beansrowning added a commit to CDCgov/SaviR that referenced this pull request May 25, 2022
- See rstudio/gt#912
- quoted columns not passed thru to sub_missing, throwing error in vignette production on CI pipeline
- Requiring gt >=0.6, fmt_missing -> sub_missing
rich-iannone added a commit that referenced this pull request Sep 7, 2022
Incorrect code was added in #912 and the order is reversed (so the conditional always prepends existing formatter list with new formatting directives).
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.

Add the sub_large_vals() function Add the sub_small_vals() function Add the sub_zero() function

2 participants