I am running frequencies for a peer-reviewed research paper and need to combine output into a table. An example of the format can be found here under "Results".
Essentially, it follows a style of heading/variable, with categories indented below, and n(%), either in one column or two.
I've tried to figure out a way to combine summarytools::freq() and knittr::kable() to get tables styled this way. One thing that I've tried is combining multiple freq() %>% as.data.frame() statements with bind_rows(). But that output is not very pretty.
I'm trying to avoid having to do a lot of cutting and pasting in Word because there were be a lot of tables, and I would like to get as close as possible to the desired format in my output. Any pointers?
Thank you!
You can use the xtable package in Rmarkdown to generate literature/research tables. This is the rmarkdown setup I used:
Result: