htmlrr-markdownsummarytools

dfSummary - formatting factor levels in html output in Rmarkdown?


I'm trying to put together an html rmd report and having an issue with how summarytools::dfSummary displays factor levels. When I print to browser or R-Studio viewer, levels are formatted so that they are stacked vertically:

enter image description here

When I print to html in R Markdown they are formatted inline, which is annoying and less readable:

enter image description here

Any ideas on how to deal with this? I've looked around and haven't seen any way to deal with this in the print() function for summarytools::, maybe there's a way for me to reformat this in rmd?

Thanks.


Solution

  • I spent a day looking for a solution, so apparently summarytools’ CSS has been included in the following manner, with chunk option echo = FALSE:

    ` ``{r echo=FALSE, results='asis'}

    st_css()

    ` ``