forestly_adsl$TRTA <- factor(
forestly_adsl$TRT01A,
levels = c("Xanomeline Low Dose", "Placebo"),
labels = c("Low Dose", "Placebo")
)
forestly_adae$TRTA <- factor(
forestly_adae$TRTA,
levels = c("Xanomeline Low Dose", "Placebo"),
labels = c("Low Dose", "Placebo")
)
outdata <- meta_forestly(
dataset_adsl = forestly_adsl[1:40, ],
dataset_adae = forestly_adae[1:40, ]
) |>
prepare_ae_forestly()|>
format_ae_forestly()
p1 <- substitute(
plot_dot(
tbl,
prop_cols = c("prop_1", "prop_2"),
y_var = "name",
label = c("Treatment", "Placebo")
)
)
p2 <- substitute(
plot_errorbar(
tbl,
ci_cols = c("diff_1", "lower_1", "upper_1"),
y_var = "name",
label = c("Treatment", "Placebo"),
legend_nrow = NULL,
theme = theme_panel(show_ticks = FALSE, show_text = FALSE)
)
)
p3 <- substitute(
table_panel(
tbl,
n_cols = c("n_1", "n_2"),
prop_cols = c("prop_1", "prop_2"),
y_var = "name",
theme = theme_panel(show_ticks = FALSE, show_text = FALSE),
x_label = c("Treatment \n n(%)", "Placebo \n n(%)")
)
)
outdata |> rtf_static_forestly(
plot_calls = c(p1, p2, p3),
source = "Source: [CDISCpilot: adam-adsl; adae]",
path_outdata = tempfile(fileext = ".Rdata"),
path_outtable = tempfile(fileext = ".rtf")
)
Run the code above in your browser using DataLab