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

For continuous data summaries, we can add units to the data summary tables.

Unit data

We make a named list with units for each column we are summarizing.

units <- list(WT = "(kg)", BMI = "(kg/m2)", SCR = "(g/dL)")

Here we created the list manually; you can also pull this information out of the data specification object.

Example

We pass this unit list into the continuous covariate table function

library(pmtables)

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

pt_cont_long(
  data, 
  cols = "BMI,SCR,WT", 
  units = units
)
pt_cont_wide(
  data, 
  cols = "WT,BMI,SCR", 
  units = units
)


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