I'd like to generate a descriptive Table using arsenal. Unfortunately some of the data is a factor.
Here is the df
df<-data.frame(group=rep(c("A","B","c"),3), value1=c(1:9), value2=as.character(floor(runif(9,2000,2010))), dummy=rep(c("Yes","No","No")))
Value2 is as.character intentionally, to show the later problem and for later analysis I'd like to keep it as is.
The standard table would be generated like this:
desTab<-tableby(~value1 +as.numeric(value2) + dummy, data= df)
summary(desTab, labelTranslations = labs1, digits= 0)
Leading to an output as follows in Markdown:
I'd like to change the labels so the table does not show the "as.numeric()" anymore.
labs1<-list(
value1 = "Value",
as.numeric(value2) = "Year",
dummy = "Dummy"
)
However, this does not solve the labs for "as.numeric".
I'd like the labeling to be like so:
Thanks for any help and advice!