Skip to contents

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.

Usage

gt_fa_repeats(
  gt_object,
  column,
  name = NULL,
  ...,
  palette = NULL,
  align = "left",
  direction = 1
)

Arguments

gt_object

An existing gt table object of class gt_tbl

column

The column wherein the integers should be replaced with {fontawesome} icons.

name

A character string indicating the name of the "fontawesome icon.

...

Additional arguments passed to fontawesome::fa()

palette

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).

align

Character string indicating alignment of the column, defaults to "left"

direction

The direction of the paletteer palette, should be either -1 for reversed or the default of 1 for the existing direction.

Value

An object of class gt_tbl.

Examples

library(gt)
mtcars[1:5, 1:4] %>%
  gt() %>%
  gt_fa_repeats(cyl, name = "car")

Figures

Function ID

2-8