fmt_pct_extra: Convert to percent and show less than 1% as <1% in grey

View source: R/fmt_pct_extra.R

fmt_pct_extraR Documentation

Convert to percent and show less than 1% as <1% in grey

Description

Convert to percent and show less than 1% as <1% in grey

Usage

fmt_pct_extra(gt_object, columns, ..., scale = 1)

Arguments

gt_object

An existing gt table

columns

The columns to affect

...

Additional argument passed to scales::label_percent()

scale

A number to multiply values by, defaults to 1

Value

a gt table

See Also

Other Utilities: add_text_img(), fa_icon_repeat(), fmt_pad_num(), fmt_symbol_first(), generate_df(), gt_add_divider(), gt_badge(), gt_double_table(), gt_duplicate_column(), gt_fa_column(), gt_fa_rank_change(), gt_fa_rating(), gt_fa_repeats(), gt_highlight_cols(), gt_highlight_rows(), gt_img_border(), gt_img_circle(), gt_img_multi_rows(), gt_img_rows(), gt_index(), gt_merge_stack_color(), gt_merge_stack(), gt_two_column_layout(), gtsave_extra(), img_header(), pad_fn(), tab_style_by_grp()

Examples

library(gt)
pct_tab <- dplyr::tibble(x = c(.001, .05, .008, .1, .2, .5, .9)) %>%
  gt::gt() %>%
  fmt_pct_extra(x, scale = 100, accuracy = .1)

gtExtras documentation built on Sept. 16, 2023, 1:08 a.m.