set.seed(1977)
diagnosis <- as.Date(round(runif(10, min = 35000, max = 40000)),
origin = "1899-12-30")
death <- as.Date(round(runif(10, min = 35000, max = 40000)),
origin = "1899-12-30")
vars <- list(diagnosis, death)
nams <- c("Diagnosis", "Death")
group <- sample(c(rep("A", 50), rep("B", 50)))
subset <- c(1:70, 91:100)
tableDate(vars, nams, group, subset, stats = c("n",
"min", "q1", "median", "mean", "q3", "max", "na"),
col.tit = NA, print.pval = TRUE, cap =
"Table of date variables.", lab = "tab: descr stat date")
## for backward compatibility, disp.cols is still working
tableDate(vars, nams, group, subset, disp.cols = c("n", "na", "min", "max"),
col.tit = c("observations", "percentage", "cum. percentage"),
print.pval = TRUE, cap = "Table of date variables.", lab = "tab: descr stat date")
Run the code above in your browser using DataLab