Add a dumbbell plot in place of two columns
Arguments
- gt_object
an existing gt_tbl or pipeline
- col1
column 1, plot will replace this column
- col2
column 2, will be hidden
- label
an optional new label for the transformed column
- palette
must be 3 colors in order of col1, col2, bar color
- width
width in mm, defaults to 70
- text_args
A list of named arguments. Optional text arguments passed as a list to
scales::label_number
.- text_size
A number indicating the size of the text indicators in the plot. Defaults to 1.5. Can also be set to
0
to "remove" the text itself.
Examples
head(mtcars) %>%
gt() %>%
gt_plt_dumbbell(disp, mpg)