TL Catalog
  1. Tables
  2. Adverse Events
  3. TSFAE01A
  • Introduction

  • Index

  • Tables
    • Adverse Events
      • TSFAE01A
      • TSFAE01B
      • TSFAE02
      • TSFAE02A
      • TSFAE03
      • TSFAE03A
      • TSFAE04
      • TSFAE04A
      • TSFAE05
      • TSFAE05A
      • TSFAE06A
      • TSFAE06B
      • TSFAE07A
      • TSFAE07B
      • TSFAE08
      • TSFAE09
      • TSFAE10
      • TSFAE11
      • TSFAE12
      • TSFAE13
      • TSFAE14
      • TSFAE15
      • TSFAE16
      • TSFAE17A
      • TSFAE17B
      • TSFAE17C
      • TSFAE17D
      • TSFAE19A
      • TSFAE19B
      • TSFAE19C
      • TSFAE19D
      • TSFAE20A
      • TSFAE20B
      • TSFAE20C
      • TSFAE21A
      • TSFAE21B
      • TSFAE21C
      • TSFAE21D
      • TSFAE22A
      • TSFAE22B
      • TSFAE22C
      • TSFAE23A
      • TSFAE23B
      • TSFAE23C
      • TSFAE23D
      • TSFAE24A
      • TSFAE24B
      • TSFAE24C
      • TSFAE24D
      • TSFAE24F
      • TSFDTH01
    • Clinical Laboratory Evaluation
      • TSFLAB01
      • TSFLAB01A
      • TSFLAB02
      • TSFLAB02A
      • TSFLAB02B
      • TSFLAB03
      • TSFLAB03A
      • TSFLAB04A
      • TSFLAB04B
      • TSFLAB05
      • TSFLAB06
      • TSFLAB07
    • Demographic
      • TSIDEM01
      • TSIDEM02
      • TSIMH01
    • Disposition of Subjects
      • TSIDS01
      • TSIDS02
      • TSIDS02A
    • Electrocardiograms
      • TSFECG01
      • TSFECG01A
      • TSFECG02
      • TSFECG03
      • TSFECG04
      • TSFECG05
    • Exposure
      • TSIEX01
      • TSIEX02
      • TSIEX03
      • TSIEX04
      • TSIEX06
      • TSIEX07
      • TSIEX08
      • TSIEX09
      • TSIEX10
      • TSIEX11
    • Pharmacokinetics
      • TPK01A
      • TPK01B
      • TPK02
      • TPK03
    • Prior and Concomitant Therapies
      • TSICM01
      • TSICM02
      • TSICM03
      • TSICM04
      • TSICM05
      • TSICM06
      • TSICM07
      • TSICM08
    • Vital Signs and Physical Findings
      • TSFVIT01
      • TSFVIT01A
      • TSFVIT02
      • TSFVIT03
      • TSFVIT04
      • TSFVIT05
      • TSFVIT06
  • Listings
    • Adverse Events
      • LSFAE01
      • LSFAE02
      • LSFAE03
      • LSFAE04
      • LSFAE05
      • LSFAE06A
      • LSFAE06B
      • LSFDTH01
    • Clinical Laboratory Evaluation
      • LSFLAB01
    • Demographic
      • LSIDEM01
      • LSIDEM02
      • LSIMH01
    • Disposition of Subjects
      • LSIDS01
      • LSIDS02
      • LSIDS03
      • LSIDS04
      • LSIDS05
    • Electrocardiograms
      • LSFECG01
      • LSFECG02
    • Exposure
      • LSIEX01
      • LSIEX02
      • LSIEX03
    • Prior and Concomitant Therapies
      • LSICM01
    • Vital Signs and Physical Findings
      • LSFVIT01
      • LSFVIT02

  • Reproducibility

  • Changelog

On this page

  • Output
  • Edit this page
  • Report an issue
  1. Tables
  2. Adverse Events
  3. TSFAE01A

TSFAE01A

Overall Summary of Subjects With Treatment-emergent Adverse Events


Output

  • Preview
Code
# Program Name:              tsfae01a

# Prep environment:

library(envsetup)
library(tern)
library(dplyr)
library(rtables)
library(junco)

# Define script level parameters:

tblid <- "TSFAE01a"
fileid <- tblid
popfl <- "SAFFL"
trtvar <- "TRT01A"
tab_titles <- get_titles_from_file(input_path = '../../_data/', tblid)
string_map <- default_str_map

# Process data:

adsl <- pharmaverseadamjnj::adsl %>%
  filter(!!rlang::sym(popfl) == "Y") %>%
  create_colspan_var(
    non_active_grp = "Placebo",
    non_active_grp_span_lbl = " ",
    active_grp_span_lbl = "Active Study Agent",
    colspan_var = "colspan_trt",
    trt_var = trtvar
  ) %>%
  mutate(
    rrisk_header = "Risk Difference (%) (95% CI)",
    rrisk_label = paste(!!rlang::sym(trtvar), "vs Placebo")
  ) %>%
  select(
    USUBJID,
    !!rlang::sym(popfl),
    !!rlang::sym(trtvar),
    colspan_trt,
    rrisk_header,
    rrisk_label
  )

adae <- pharmaverseadamjnj::adae %>%
  filter(TRTEMFL == "Y") %>%
  select(
    USUBJID,
    AESER,
    AESDTH,
    AESLIFE,
    AESHOSP,
    AESDISAB,
    AESCONG,
    AESMIE,
    AEACN_DECODE,
    AESEV
  ) %>%
  group_by(USUBJID) %>%
  mutate(maxsev = max(as.character(AESEV), na.rm = TRUE)) %>%
  ungroup() %>%
  mutate(maxsev = ifelse(is.na(maxsev), "Missing", maxsev)) %>%
  mutate(
    maxsev = factor(maxsev, levels = c("Mild", "Moderate", "Severe", "Missing"))
  )

adae <- inner_join(adae, adsl, by = c("USUBJID"))

# Define layout and build table:

colspan_trt_map <- create_colspan_map(
  adsl,
  non_active_grp = "Placebo",
  non_active_grp_span_lbl = " ",
  active_grp_span_lbl = "Active Study Agent",
  colspan_var = "colspan_trt",
  trt_var = trtvar
)

# Check the levels of AEACN_DECODE

aeacn_levels <- levels(adae$AEACN_DECODE)
# Here we are not considering "Drug Withdrawn", "Dose Not Changed", "Not Applicable"
excl_aeacn_levels <- c("Drug Withdrawn", "Dose Not Changed", "Not Applicable")
dosemod_lvls <- aeacn_levels[!(aeacn_levels %in% excl_aeacn_levels)]


## rearrange levels for AEACN_DECODE

newsort_AEACN_DECODE <- unique(c(
  "Drug Interrupted",
  "Dose Reduced",
  "Dose Rate Reduced",
  "Dose Increased",
  "Unknown",
  aeacn_levels
))

adae$AEACN_DECODE <- forcats::fct_relevel(
  adae$AEACN_DECODE,
  newsort_AEACN_DECODE
)

## mapping table for label updates

dosemod_lblmap <- tibble(value = dosemod_lvls, label = dosemod_lvls) %>%
  mutate(
    label = case_when(
      value == "Dose Increased" ~ label,
      value == "Dose Reduced" ~ "Reduction of study treatment",
      value == "Drug Interrupted" ~ "Interruption of study treatment",
      TRUE ~ label
    )
  )


dosemod_spf <- make_combo_splitfun(
  nm = "modified",
  label = "AE leading to dose modification of study",
  levels = c(
    "Dose Reduced",
    "Dose Increased",
    "Drug Interrupted",
    "Dose Rate Reduced",
    "Unknown"
  )
)
aesevall_spf <- make_combo_splitfun(
  nm = "AESEV_ALL",
  label = "Any AE~[super a]",
  levels = NULL
)


rr_method <- "wald"
ref_path <- c("colspan_trt", " ", trtvar, "Placebo")
extra_args_rr <- list(
  method = rr_method,
  ref_path = ref_path,
  .stats = c("count_unique_fraction")
)

lyt <- basic_table(
  show_colcounts = TRUE,
  colcount_format = "N=xx",
  top_level_section_div = " "
) %>%
  append_topleft(c(" ", " ", "Event, n (%)")) %>%
  split_cols_by(
    "colspan_trt",
    split_fun = trim_levels_to_map(map = colspan_trt_map)
  ) %>%
  split_cols_by(trtvar) %>%
  split_cols_by("rrisk_header", nested = FALSE) %>%
  split_cols_by(
    trtvar,
    labels_var = "rrisk_label",
    split_fun = remove_split_levels("Placebo")
  ) %>%
  split_rows_by(
    "AESER",
    split_fun = keep_split_levels("Y"),
    section_div = " "
  ) %>%
  summarize_row_groups(
    "AESER",
    cfun = a_freq_j,
    extra_args = list(
      label = "SAE",
      method = rr_method,
      ref_path = ref_path,
      .stats = c("count_unique_fraction")
    )
  ) %>%
  analyze(
    "AESDTH",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(label = "With fatal outcome", val = "Y", NULL)
    )
  ) %>%
  analyze(
    "AESLIFE",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(label = "Life-threatening", val = "Y", NULL)
    )
  ) %>%
  analyze(
    "AESHOSP",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(label = "Requiring or prolonging hospitalization", val = "Y", NULL)
    )
  ) %>%
  analyze(
    "AESDISAB",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(
        label = "Resulting in persistent or significant disability/incapacity",
        val = "Y",
        NULL
      )
    )
  ) %>%
  analyze(
    "AESCONG",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(label = "Congenital anomaly or birth defect", val = "Y", NULL)
    )
  ) %>%
  analyze(
    "AESMIE",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(extra_args_rr, list(label = "Other", val = "Y", NULL))
  ) %>%
  analyze(
    "AEACN_DECODE",
    afun = a_freq_j,
    nested = FALSE,
    extra_args = append(
      extra_args_rr,
      list(
        label = "AE leading to permanent discontinuation of study treatment",
        val = "Drug Withdrawn",
        NULL
      )
    )
  ) %>%
  split_rows_by("AEACN_DECODE", split_fun = dosemod_spf, section_div = " ") %>%
  summarize_row_groups(
    "AEACN_DECODE",
    cfun = a_freq_j,
    extra_args = list(
      label = "AE leading to dose modification of study treatment",
      method = rr_method,
      ref_path = ref_path,
      .stats = c("count_unique_fraction")
    )
  ) %>%
  analyze(
    "AEACN_DECODE",
    table_names = "AEACN_DECODE",
    a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(
        excl_levels = excl_aeacn_levels,
        label_map = dosemod_lblmap,
        drop_levels = TRUE
      )
    )
  ) %>%
  split_rows_by("maxsev", split_fun = aesevall_spf) %>%
  summarize_row_groups(
    "maxsev",
    cfun = a_freq_j,
    extra_args = list(
      label = "Any AE~[super a]",
      method = rr_method,
      ref_path = ref_path,
      .stats = c("count_unique_fraction")
    )
  ) %>%
  analyze("maxsev", afun = a_freq_j, extra_args = append(extra_args_rr, NULL))


result <- build_table(lyt, adae, alt_counts_df = adsl)

# Post-Processing:

result <- remove_col_count(result)
result <- safe_prune_table(
  result,
  prune_func = count_pruner(
    cat_exclude = c(
      "With fatal outcome",
      "Life-threatening",
      "Requiring or prolonging hospitalization",
      "Resulting in persistent or significant disability/incapacity",
      "Congenital anomaly or birth defect",
      "Other"
    )
  )
)

# Add titles and footnotes:

result <- set_titles(result, tab_titles)

# Convert to tbl file and output table:

tt_to_tlgrtf(string_map = string_map, tt = result, file = fileid, orientation = "landscape")

TSFAE01a: Overall Summary of Subjects With Treatment-emergent Adverse Events; Safety Analysis Set (Study jjcs - core)

Active Study Agent

Risk Difference (%) (95% CI)

Xanomeline High Dose

Xanomeline Low Dose

Placebo

Xanomeline High Dose vs Placebo

Xanomeline Low Dose vs Placebo

Event, n (%)

N=53

N=73

N=59

SAE

47 (88.7%)

54 (74.0%)

37 (62.7%)

26.0 (11.0, 41.0)

11.3 (-4.7, 27.2)

With fatal outcome

0

1 (1.4%)

1 (1.7%)

-1.7 (-5.0, 1.6)

-0.3 (-4.6, 3.9)

Life-threatening

0

1 (1.4%)

1 (1.7%)

-1.7 (-5.0, 1.6)

-0.3 (-4.6, 3.9)

Requiring or prolonging
 hospitalization

2 (3.8%)

2 (2.7%)

3 (5.1%)

-1.3 (-8.9, 6.3)

-2.3 (-9.1, 4.4)

Resulting in persistent or
 significant
 disability/incapacity

0

1 (1.4%)

0

0.0 (0.0, 0.0)

1.4 (-1.3, 4.0)

Congenital anomaly or birth
 defect

0

0

0

0.0 (0.0, 0.0)

0.0 (0.0, 0.0)

Other

47 (88.7%)

54 (74.0%)

37 (62.7%)

26.0 (11.0, 41.0)

11.3 (-4.7, 27.2)

AE leading to permanent
 discontinuation of study
 treatment

23 (43.4%)

20 (27.4%)

18 (30.5%)

12.9 (-4.9, 30.7)

-3.1 (-18.7, 12.5)

AE leading to dose modification
 of study treatment

51 (96.2%)

56 (76.7%)

40 (67.8%)

28.4 (15.5, 41.4)

8.9 (-6.5, 24.3)

Interruption of study
 treatment

28 (52.8%)

35 (47.9%)

19 (32.2%)

20.6 (2.7, 38.6)

15.7 (-0.8, 32.3)

Reduction of study treatment

24 (45.3%)

26 (35.6%)

17 (28.8%)

16.5 (-1.2, 34.2)

6.8 (-9.1, 22.7)

Dose Rate Reduced

31 (58.5%)

27 (37.0%)

15 (25.4%)

33.1 (15.8, 50.4)

11.6 (-4.1, 27.2)

Dose Increased

27 (50.9%)

25 (34.2%)

18 (30.5%)

20.4 (2.6, 38.3)

3.7 (-12.3, 19.8)

Unknown

24 (45.3%)

31 (42.5%)

13 (22.0%)

23.2 (6.2, 40.3)

20.4 (4.9, 35.9)

Any AEa

51 (96.2%)

62 (84.9%)

42 (71.2%)

25.0 (12.4, 37.7)

13.7 (-0.4, 27.9)

Mild

17 (32.1%)

15 (20.5%)

23 (39.0%)

-6.9 (-24.6, 10.8)

-18.4 (-34.0, -2.9)

Moderate

31 (58.5%)

35 (47.9%)

16 (27.1%)

31.4 (13.9, 48.8)

20.8 (4.7, 37.0)

Severe

3 (5.7%)

12 (16.4%)

3 (5.1%)

0.6 (-7.8, 8.9)

11.4 (1.2, 21.5)

a Dose modifications as collected on the AE CRF are presented. Subjects may be counted once for each modification type.

b The event experienced by the subject with the worst severity is used.

Download RTF file

TSFAE01B
Source Code
---
title: TSFAE01A
subtitle: Overall Summary of Subjects With Treatment-emergent Adverse Events
---

------------------------------------------------------------------------

{{< include ../../_utils/envir_hook.qmd >}}

```{r setup, echo = FALSE, warning = FALSE, message = FALSE}
options(docx.add_datetime = FALSE, tidytlg.add_datetime = FALSE)
envsetup_config_name <- "default"

# Path to the combined config file
envsetup_file_path <- file.path("../..", "envsetup.yml")

Sys.setenv(ENVSETUP_ENVIRON = '')
library(envsetup)
loaded_config <- config::get(config = envsetup_config_name, file = envsetup_file_path)
envsetup::rprofile(loaded_config)


dpscomp <- compound
dpspdr <- paste(protocol,dbrelease,rpteff,sep="__")

aptcomp <- compound
aptpdr <- paste(protocol,dbrelease,rpteff,sep="__")

###### Study specific updates (formerly in envre)

dpscomp <- "standards"
dpspdr <- "jjcs__NULL__jjcs - core"

apt <- FALSE
library(junco)
default_str_map <- rbind(default_str_map, c("&ctcae", "5.0"))

```

## Output

:::: panel-tabset
## {{< fa regular file-lines sm fw >}} Preview

```{r variant1, results='hide', warning = FALSE, message = FALSE}

# Program Name:              tsfae01a

# Prep environment:

library(envsetup)
library(tern)
library(dplyr)
library(rtables)
library(junco)

# Define script level parameters:

tblid <- "TSFAE01a"
fileid <- tblid
popfl <- "SAFFL"
trtvar <- "TRT01A"
tab_titles <- get_titles_from_file(input_path = '../../_data/', tblid)
string_map <- default_str_map

# Process data:

adsl <- pharmaverseadamjnj::adsl %>%
  filter(!!rlang::sym(popfl) == "Y") %>%
  create_colspan_var(
    non_active_grp = "Placebo",
    non_active_grp_span_lbl = " ",
    active_grp_span_lbl = "Active Study Agent",
    colspan_var = "colspan_trt",
    trt_var = trtvar
  ) %>%
  mutate(
    rrisk_header = "Risk Difference (%) (95% CI)",
    rrisk_label = paste(!!rlang::sym(trtvar), "vs Placebo")
  ) %>%
  select(
    USUBJID,
    !!rlang::sym(popfl),
    !!rlang::sym(trtvar),
    colspan_trt,
    rrisk_header,
    rrisk_label
  )

adae <- pharmaverseadamjnj::adae %>%
  filter(TRTEMFL == "Y") %>%
  select(
    USUBJID,
    AESER,
    AESDTH,
    AESLIFE,
    AESHOSP,
    AESDISAB,
    AESCONG,
    AESMIE,
    AEACN_DECODE,
    AESEV
  ) %>%
  group_by(USUBJID) %>%
  mutate(maxsev = max(as.character(AESEV), na.rm = TRUE)) %>%
  ungroup() %>%
  mutate(maxsev = ifelse(is.na(maxsev), "Missing", maxsev)) %>%
  mutate(
    maxsev = factor(maxsev, levels = c("Mild", "Moderate", "Severe", "Missing"))
  )

adae <- inner_join(adae, adsl, by = c("USUBJID"))

# Define layout and build table:

colspan_trt_map <- create_colspan_map(
  adsl,
  non_active_grp = "Placebo",
  non_active_grp_span_lbl = " ",
  active_grp_span_lbl = "Active Study Agent",
  colspan_var = "colspan_trt",
  trt_var = trtvar
)

# Check the levels of AEACN_DECODE

aeacn_levels <- levels(adae$AEACN_DECODE)
# Here we are not considering "Drug Withdrawn", "Dose Not Changed", "Not Applicable"
excl_aeacn_levels <- c("Drug Withdrawn", "Dose Not Changed", "Not Applicable")
dosemod_lvls <- aeacn_levels[!(aeacn_levels %in% excl_aeacn_levels)]


## rearrange levels for AEACN_DECODE

newsort_AEACN_DECODE <- unique(c(
  "Drug Interrupted",
  "Dose Reduced",
  "Dose Rate Reduced",
  "Dose Increased",
  "Unknown",
  aeacn_levels
))

adae$AEACN_DECODE <- forcats::fct_relevel(
  adae$AEACN_DECODE,
  newsort_AEACN_DECODE
)

## mapping table for label updates

dosemod_lblmap <- tibble(value = dosemod_lvls, label = dosemod_lvls) %>%
  mutate(
    label = case_when(
      value == "Dose Increased" ~ label,
      value == "Dose Reduced" ~ "Reduction of study treatment",
      value == "Drug Interrupted" ~ "Interruption of study treatment",
      TRUE ~ label
    )
  )


dosemod_spf <- make_combo_splitfun(
  nm = "modified",
  label = "AE leading to dose modification of study",
  levels = c(
    "Dose Reduced",
    "Dose Increased",
    "Drug Interrupted",
    "Dose Rate Reduced",
    "Unknown"
  )
)
aesevall_spf <- make_combo_splitfun(
  nm = "AESEV_ALL",
  label = "Any AE~[super a]",
  levels = NULL
)


rr_method <- "wald"
ref_path <- c("colspan_trt", " ", trtvar, "Placebo")
extra_args_rr <- list(
  method = rr_method,
  ref_path = ref_path,
  .stats = c("count_unique_fraction")
)

lyt <- basic_table(
  show_colcounts = TRUE,
  colcount_format = "N=xx",
  top_level_section_div = " "
) %>%
  append_topleft(c(" ", " ", "Event, n (%)")) %>%
  split_cols_by(
    "colspan_trt",
    split_fun = trim_levels_to_map(map = colspan_trt_map)
  ) %>%
  split_cols_by(trtvar) %>%
  split_cols_by("rrisk_header", nested = FALSE) %>%
  split_cols_by(
    trtvar,
    labels_var = "rrisk_label",
    split_fun = remove_split_levels("Placebo")
  ) %>%
  split_rows_by(
    "AESER",
    split_fun = keep_split_levels("Y"),
    section_div = " "
  ) %>%
  summarize_row_groups(
    "AESER",
    cfun = a_freq_j,
    extra_args = list(
      label = "SAE",
      method = rr_method,
      ref_path = ref_path,
      .stats = c("count_unique_fraction")
    )
  ) %>%
  analyze(
    "AESDTH",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(label = "With fatal outcome", val = "Y", NULL)
    )
  ) %>%
  analyze(
    "AESLIFE",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(label = "Life-threatening", val = "Y", NULL)
    )
  ) %>%
  analyze(
    "AESHOSP",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(label = "Requiring or prolonging hospitalization", val = "Y", NULL)
    )
  ) %>%
  analyze(
    "AESDISAB",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(
        label = "Resulting in persistent or significant disability/incapacity",
        val = "Y",
        NULL
      )
    )
  ) %>%
  analyze(
    "AESCONG",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(label = "Congenital anomaly or birth defect", val = "Y", NULL)
    )
  ) %>%
  analyze(
    "AESMIE",
    afun = a_freq_j,
    show_labels = "hidden",
    extra_args = append(extra_args_rr, list(label = "Other", val = "Y", NULL))
  ) %>%
  analyze(
    "AEACN_DECODE",
    afun = a_freq_j,
    nested = FALSE,
    extra_args = append(
      extra_args_rr,
      list(
        label = "AE leading to permanent discontinuation of study treatment",
        val = "Drug Withdrawn",
        NULL
      )
    )
  ) %>%
  split_rows_by("AEACN_DECODE", split_fun = dosemod_spf, section_div = " ") %>%
  summarize_row_groups(
    "AEACN_DECODE",
    cfun = a_freq_j,
    extra_args = list(
      label = "AE leading to dose modification of study treatment",
      method = rr_method,
      ref_path = ref_path,
      .stats = c("count_unique_fraction")
    )
  ) %>%
  analyze(
    "AEACN_DECODE",
    table_names = "AEACN_DECODE",
    a_freq_j,
    show_labels = "hidden",
    extra_args = append(
      extra_args_rr,
      list(
        excl_levels = excl_aeacn_levels,
        label_map = dosemod_lblmap,
        drop_levels = TRUE
      )
    )
  ) %>%
  split_rows_by("maxsev", split_fun = aesevall_spf) %>%
  summarize_row_groups(
    "maxsev",
    cfun = a_freq_j,
    extra_args = list(
      label = "Any AE~[super a]",
      method = rr_method,
      ref_path = ref_path,
      .stats = c("count_unique_fraction")
    )
  ) %>%
  analyze("maxsev", afun = a_freq_j, extra_args = append(extra_args_rr, NULL))


result <- build_table(lyt, adae, alt_counts_df = adsl)

# Post-Processing:

result <- remove_col_count(result)
result <- safe_prune_table(
  result,
  prune_func = count_pruner(
    cat_exclude = c(
      "With fatal outcome",
      "Life-threatening",
      "Requiring or prolonging hospitalization",
      "Resulting in persistent or significant disability/incapacity",
      "Congenital anomaly or birth defect",
      "Other"
    )
  )
)

# Add titles and footnotes:

result <- set_titles(result, tab_titles)

# Convert to tbl file and output table:

tt_to_tlgrtf(string_map = string_map, tt = result, file = fileid, orientation = "landscape")
```
```{r result1, echo=FALSE, message=FALSE, warning=FALSE, test = list(result_v1 = "result")}
tt_to_flextable_j(result, tblid, string_map = string_map) 
```

[Download RTF file](`r paste0(tolower(tblid), '.rtf')`)
::::

Made with ❤️ by the J&J Team

  • Edit this page
  • Report an issue
Cookie Preferences