West_End_Line
West_End_Line

Reputation: 199

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.

Upvotes: 1

Views: 412

Answers (1)

yuliaUU
yuliaUU

Reputation: 1713

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()

` ``

Upvotes: 1

Related Questions