Below I will set up a data frame to mimic the content from our goal table. The workhorse function from the knitr package for table creation is the kable() function, and the primary input to the kable() function is a data frame. Table 7.6 from the 7th edition of the APA Publication Manual (p. 213). To illustrate my process for table creation using LaTeX, I will attempt to re-create the following table from the 7th edition of the APA Publication Manual. This can set up an entire RMarkdown document to adhere to APA formatting, but is beyond the scope of what I typically need. It may also be worth mentioning the papaja package package. The closest I get with HTML (without using bookdown) seems to be the flextable package. My experience with HTML and APA is that I can get really close, but there are one or two elements that I can’t seem to get formatted correctly, which varies depending on the package I try. I also use LaTeX and PDF output when I need to really format using the APA style. I settled on knitr because of its robustness and ease of use-along with kableExtra, it can create almost any table I can imagine using a general set of syntax. There are many packages for formatting tables, among others, include the flextable package, the gt package, the huxtable package, and the expss package. The kable() function from the knitr package and.When I create tables using RMarkdown, the primary packages I use are: There are several packages that help in this endeavor when working in an Rmarkdown document. Often it is useful to format table output to make it look good or to adhere a particular style (e.g., APA).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |