Last chance! 50% off unlimited learning
Sale ends in
Last chance! 50% off unlimited learning
Sale ends in
{fontawesome}
icons based on an integer.The gt_fa_repeats
function takes an existing gt_tbl
object and
adds specific fontawesome
to the cells. The icons are repeated according to the
integer that the column contains.
gt_fa_repeats(
gt_object,
column,
name = NULL,
...,
palette = NULL,
align = "left",
direction = 1
)
An object of class gt_tbl
.
An existing gt table object of class gt_tbl
The column wherein the integers should be replaced with {fontawesome}
icons.
A character string indicating the name of the "fontawesome
icon.
Additional arguments passed to fontawesome::fa()
Name of palette as a string. Must be either length of 1 or a vector of valid color names/hex values of equal length to the unique levels of the column (ie if there are 4 names, there need to be 4x colors).
Character string indicating alignment of the column, defaults to "left"
The direction of the paletteer
palette, should be either -1
for reversed or the default of 1
for the existing direction.
library(gt)
mtcars[1:5, 1:4] %>%
gt() %>%
gt_fa_repeats(cyl, name = "car")
2-8
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_rating()
,
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()