Abstract
This is a template and minimal example for using papaja and pkgdown to share the results of a research project on the web. papaja is used to write an APA style manuscript. pkgdown is used to create a website from an R package. Putting the two together let’s you share the APA paper in the form of a pkgdown website. This has the added benefit of being able to share the whole project as an R package, along with data (and pretty documentation for the data), and any custom functions used for analysis.This introduction briefly describes the steps I took to make this template.
Documentation for papaja can be found here https://crsh.github.io/papaja_man/
Installation instructions for papaja are here: https://crsh.github.io/papaja_man/introduction.html#getting-started
Install pkgdown https://pkgdown.r-lib.org
Also, read up a bit on making R-packages here http://r-pkgs.had.co.nz
Install the roxygen2 package.
pkgdown::build_site()
in the console. This should build a simple website. The reference tab will be used to list any custom functions that you use in your data-analysis, and to list data files along with documentation for the data files. The articles tab will display a web-based version of the papaja manuscript.In this example I created a data.frame called test_data
, and saved it to a data
folder in the R project. I then added a data.R
file to the R
folder (which stores R scripts). This file uses roxygen2 to document details about this test data set. There is plenty of more info about this in th R-packages book by Hadley Wickham http://r-pkgs.had.co.nz
Aust, Frederik, and Marius Barth. 2018. papaja: Create APA Manuscripts with R Markdown. https://github.com/crsh/papaja.
R Core Team. 2017. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.