I'm wondering if anyone out there is familiar enough with the vtable package to diagnose why one of the scenarios below is working while the other is not. The second approach drops the labeled variable from the table that is created. I am an R newbie so maybe it's obvious. I also tried the second approach after creating labels with Hmisc instead of expss and it made no difference.
library('vtable')
library('expss')
data(mtcars)
#Works
label <- data.frame(
mpg = "Miles per gallon"
)
sumtable(mtcars, group = 'cyl', group.test = TRUE, labels = label)
#does not work
mtcars = apply_labels(mtcars,
mpg = "Miles per gallon"
)
sumtable(mtcars, group = 'cyl', group.test = TRUE, labels = TRUE)