I'm surprised that works at all!
How about using verbatimTextOutput() and renderPrint()? That would make it readable, although admittedly, it would look pretty barebones.
You could tidy up the data before putting it in DT.
st <- summary(cars)
var <- str_trim(dimnames(st)[])
stat <- str_trim(gsub(":.+$", "", st))
value <- str_trim(gsub("^.+:", "", st))
var = rep(var, each = nrow(st)),
stat = as.vector(stat),
value = as.vector(value),
stringsAsFactors = FALSE
- Are you sure you want to display this data in tabular format? Another option would be to let people use a selectInput to choose the variable they're interested in, and you can show the summary for just that particular variable.