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

These functions create summary tables for discrete data. There is a long format and a wide format.

Long format

library(pmtables)
library(dplyr)

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

cols <- vars(Sex = SEXf,"Renal function" = RFf,"Child-Pugh" = CPf)
by <- vars(Study = STUDYf)

A summary of covariates

pt_cat_long(id, cols = cols, by = by)

Wide format

There is also a wide format, where variable names go across the table.

pt_cat_wide(id, cols = vars(Sex = SEXf,Renal = RFf), by = by)

Add panel

pt_cat_wide(
  id, 
  cols = vars(SEXf,RFf), 
  by = vars(Study=STUDYf), 
  panel = vars(Formulation = FORMf)
)


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