metrumresearchgroup / pmtables

TeX tables for pharmacometrics.
https://metrumresearchgroup.github.io/pmt-book
11 stars 1 forks source link

More built in options for pt_demographics #310

Open kylebaron opened 1 year ago

kylebaron commented 1 year ago

demo_fun <- function(value = seq(1,5), name = "",  ..., fmt = sig,
         digits = 3, maxex = 5) {
  ans <- tibble(
    `Mean (SD)` = pmtables:::.mean_sd(value, fmt = fmt, digits = digits, maxex = maxex),
     Median = sig(median(value, na.rm = TRUE)),
    `Min / Max` = pmtables:::.min_max(value, fmt = fmt, digits = digits, maxex = maxex),
    `Missing` = as.character(sum(is.na(value)), digits = digits, maxex = maxex)
  )
  ans
}

Smart drop of Missing.