Skip to content

Add the cols_merge_n_pct() function#683

Merged
rich-iannone merged 17 commits intomasterfrom
cols_merge_n_pct
Nov 18, 2020
Merged

Add the cols_merge_n_pct() function#683
rich-iannone merged 17 commits intomasterfrom
cols_merge_n_pct

Conversation

@rich-iannone
Copy link
Member

This PR adds the cols_merge_n_pct() function, which merges two columns together: a count column and a percentage column. This function will autohide the col_pct column by default (but that can be changed by setting autohide = FALSE). Different combinations of NA are given special consideration much like col_vals_uncert() function. Any zero values in the col_n column will be formatted solely as 0.

Fixes: #651

@rich-iannone rich-iannone marked this pull request as ready for review November 13, 2020 19:23
@jcheng5 jcheng5 self-requested a review November 18, 2020 18:23
@rich-iannone rich-iannone merged commit 416ca71 into master Nov 18, 2020
@rich-iannone rich-iannone deleted the cols_merge_n_pct branch November 18, 2020 18:44
rich-iannone added a commit that referenced this pull request Dec 10, 2020
* master:
  do html_preserve hack for caption only when html_preserve is active
  Add tests; process_text now handles htmltools::tags, tagList
  Get table caption rewriting working for bookdown
  Update render_as_html.R
  Add the `create_caption_component_h()` fn
  Update helper-gt_attr_expectations.R
  Create TODOs and basics caption in HTML tables
  Update gt.Rd
  Augment the `dt_options_tbl` with `table_caption`
  Add `caption` arg in `gt()`
  Add the `caption` arg to `gt()`
  Add the `cols_merge_n_pct()` function (#683)
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.

cols_merge_n_pct() for N (%) format

2 participants