View source: R/gt_plt_dumbbell.R
gt_plt_dumbbell | R Documentation |
Add a dumbbell plot in place of two columns
gt_plt_dumbbell(
gt_object,
col1 = NULL,
col2 = NULL,
label = NULL,
palette = c("#378E38", "#A926B6", "#D3D3D3"),
width = 70,
text_args = list(accuracy = 1),
text_size = 2.5
)
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 |
text_size |
A number indicating the size of the text indicators in the plot. Defaults to 1.5. Can also be set to |
a gt_object table
head(mtcars) %>% gt() %>% gt_plt_dumbbell(disp, mpg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.