rtable2gg | R Documentation |
rtable
objects to ggplot
objectsGiven a rtables::rtable()
object, performs basic conversion to a ggplot2::ggplot()
object built using
functions from the ggplot2
package. Any table titles and/or footnotes are ignored.
rtable2gg(tbl, fontsize = 12, colwidths = NULL, lbl_col_padding = 0)
tbl |
( |
fontsize |
( |
colwidths |
( |
lbl_col_padding |
( |
A ggplot
object.
dta <- data.frame(
ARM = rep(LETTERS[1:3], rep(6, 3)),
AVISIT = rep(paste0("V", 1:3), 6),
AVAL = c(9:1, rep(NA, 9))
)
lyt <- basic_table() %>%
split_cols_by(var = "ARM") %>%
split_rows_by(var = "AVISIT") %>%
analyze_vars(vars = "AVAL")
tbl <- build_table(lyt, df = dta)
rtable2gg(tbl)
rtable2gg(tbl, fontsize = 15, colwidths = c(2, 1, 1, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.