View source: R/fontawesome-icons.R
gt_fa_rating | R Documentation |
Add rating "stars" to a gt column
gt_fa_rating(
gt_object,
column,
max_rating = 5,
...,
color = "orange",
icon = "star"
)
gt_object |
An existing gt table object of class |
column |
The column wherein the numeric values should be replaced with their corresponding |
max_rating |
The max number of icons to add, these will be added in grey to indicate "missing" |
... |
Additional arguments passed to |
color |
The color of the icon, accepts named colors ( |
icon |
The icon name, passed to |
An object of class gt_tbl
.
library(gt) set.seed(37) rating_table <- mtcars %>% dplyr::select(mpg:wt) %>% dplyr::slice(1:5) %>% dplyr::mutate(rating = sample(1:5, size = 5, TRUE)) %>% gt() %>% gt_fa_rating(rating, icon = "r-project")
2-16
Other Utilities:
add_text_img()
,
fa_icon_repeat()
,
fmt_pad_num()
,
fmt_pct_extra()
,
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_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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.