rtable2gg {tern} | R Documentation |
Convert rtable
objects to ggplot
objects
Description
Given 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.
Usage
rtable2gg(tbl, fontsize = 12, colwidths = NULL, lbl_col_padding = 0)
Arguments
tbl |
( |
fontsize |
( |
colwidths |
( |
lbl_col_padding |
( |
Value
A ggplot
object.
Examples
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))
[Package tern version 0.9.5 Index]