knitr::opts_chunk$set(
collapse = TRUE,
comment = "."
)

This vignette shows how to expose the different data summary functions.

library(pmtables)
data <- pmtables:::data("id")
obs <- pmtables:::data("obs")

Continuous

Long

cont_table_data(
 data, 
 by = "STUDYf",
 cols = c("WT", "ALB", "SCR"), 
 digits = new_digits(.default = 3)
)

Wide

cont_table_data(
 data, 
 panel = "STUDYf",
 cols = c("WT", "ALB", "SCR"), 
 digits = new_digits(.default = 3), 
 fun = pt_opts$cont.wide.fun,
 wide = TRUE
)

Categorical

Long

cat_data(
  data, 
  cols = c("SEXf", "FORMf"), 
  by = "RFf"
)

Wide

cat_data(
  data, 
  cols = c("SEXf", "FORMf"), 
  by = "RFf", 
  wide = TRUE
)

Data inventory

Unstacked

data_inventory_data(
  obs, 
  by = "STUDYf"
)

Stacked

pmtables:::data_inventory_data_split(
  data,
  by = "STUDYf", 
  panel = "SEQf",
  stacked = FALSE
)


metrumresearchgroup/pmtables documentation built on Oct. 27, 2024, 5:16 p.m.