Problem
Social scientists format tables and documents with APA style. There are packages like stargazer and xtable (here is an extensive list) that provide clean table formatting for those using latex and knitr. However, these packages do not conform to APA style rules in all cases.
Building and formatting tables from scratch is time consuming. Fortunately, there are two R packages for creating tables and documents compliant with APA style guidelines: apaStyle and apaTables. Unfortunately, both packages only output to MS Word.
Questions
- Is there a way to use
APAStyleandAPATablesso that output is integrated into HTML or PDF output from a .Rmd file? - What other packages do you use to create APA style tables in your .Rmd file—especially when using
knitrto create PDF files.
Concerning your second question, check out apa_table() from Frederik Aust's package papaja. I found it incredibly helpful for reporting all output in APA style (not only tables).
- These installation instructions and user guide helped me to get started.
- However, to see how much you can actually do with
papaja, I greatly benefitted from this openly accessible example paper.
来源:https://stackoverflow.com/questions/44267088/using-apatables-or-apastyles-packages-with-knitr