View source: R/add_sparkline.R
add_sparkline | R Documentation |
This function wraps gtExtras::gt_plt_dist()
and adds a new column
illustrating the distribution of a continuous variable. This function converts
the gtsummary table into a gt table.
add_sparkline(
x,
type = c("boxplot", "histogram", "rug_strip", "density", "sparkline"),
column_header = NULL,
same_limit = FALSE,
...
)
x |
'tbl_summary' object |
type |
sparkline type. Must be one of |
column_header |
string indicating column header |
same_limit |
A logical indicating that the plots will use the same axis range ( |
... |
Arguments passed on to
|
a gt table
Example 1
Other gtsummary-related functions:
add_inline_forest_plot()
,
as_ggplot()
,
bold_italicize_group_labels()
,
logistic_reg_adj_diff()
,
style_tbl_compact()
,
tbl_likert()
,
theme_gtsummary_msk()
library(gtsummary)
add_sparkline_ex1 <-
trial %>%
select(age, marker) %>%
tbl_summary(missing = "no") %>%
add_sparkline()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.