Learn R Programming

forestly (version 0.1.4)

format_ae_forestly: Format outdata for interactive forest plot

Description

Format outdata for interactive forest plot

Usage

format_ae_forestly(
  outdata,
  display = c("n", "prop", "fig_prop", "fig_diff"),
  digits = 1,
  width_term = 200,
  width_fig = 320,
  width_n = 40,
  width_prop = 60,
  width_diff = 80,
  footer_space = 90,
  prop_range = NULL,
  diff_range = NULL,
  color = NULL,
  ae_col_header = NULL,
  diff_label = "Treatment <- Favor -> Placebo",
  diff_col_header = NULL,
  diff_fig_header = NULL
)

Value

An outdata object.

Arguments

outdata

An outdata object created by prepare_ae_forestly().

display

A character vector of measurement to be displayed.

  • n: Number of subjects with AE.

  • prop: Proportion of subjects with AE.

  • total: Total columns.

  • diff: Risk difference.

digits

A number of digits after decimal point to be displayed for proportion and risk difference.

width_term

Width in px for AE term column.

width_fig

Width in px for proportion and risk difference figure.

width_n

Width in px for "N" columns.

width_prop

Width in px for "(%)" columns.

width_diff

Width in px for risk difference columns.

footer_space

Space in px for footer to display legend.

prop_range

A vector of lower and upper limit of x-axis for proportion figure.

diff_range

A vector of lower and upper limit of x-axis for risk difference figure.

color

A vector of colors for analysis groups. Default value supports up to 4 groups.

ae_col_header

Column header for adverse events item columns. If NULL (default) and "par" specified in components from prepare_ae_forestly(), uses "Adverse Event". If NULL and "soc" specified in components from prepare_ae_forestly(), uses "System Organ Class" for "soc".

diff_label

x-axis label for risk difference.

diff_col_header

Column header for risk difference table columns. If NULL (default), uses "Risk Difference (%)
vs. Reference Group".

diff_fig_header

Column header for risk difference figure. If NULL (default), uses "Risk Difference (%) + 95% CI
vs. Reference Group".

Examples

Run this code
adsl <- forestly_adsl[1:100, ]
adae <- forestly_adae[1:100, ]
meta_forestly(
  dataset_adsl = adsl,
  dataset_adae = adae
) |>
  prepare_ae_forestly() |>
  format_ae_forestly()

Run the code above in your browser using DataLab