I am trying to play around with the formatting of the labels in summarytools::ctable with no luck.
I would like to keep the longer version of the question name on top of the table, and the shorter version of the question name inside the table (or removed altogether).
Example of long var names
library(magrittr)
library(dplyr)
library(summarytools)
mtcars %<>% rename(really_long_variable_name_for_vs = vs,
really_long_variable_name_for_gear = gear)
If I wanted xtabs of vs and gear with the the new longer names
ctable(mtcars$really_long_variable_name_for_gear,mtcars$really_long_variable_name_for_vs)
To specify shorter names I can use dnn
ctable(mtcars$really_long_variable_name_for_gear,mtcars$really_long_variable_name_for_vs,dnn = c('gear short', 'vs short'))
But I want the SHORT version of the name to appear inside the table (or not at all) And the LONG version of the var name to appear outside the table
Desired output:
I tried playing around with the options -- but no luck:
ctable(mtcars$gear,mtcars$really_long_variable_name_for_vs,
omit_headings = TRUE,
display.labels = FALSE,
dfSummary.labels.col = FALSE)