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.

Introduction

This introduction briefly describes the steps I took to make this template.

  1. First, install papaja for writing APA papers. This .Rmd file was created by modifying the template .Rmd file from papaja.

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

  1. Install pkgdown https://pkgdown.r-lib.org

  2. Also, read up a bit on making R-packages here http://r-pkgs.had.co.nz

  3. Install the roxygen2 package.

Using papaja and pkgdown together

  1. Create a new R project in R-studio, and choose the “R project” type.
  2. Add a “vignettes” folder, then create a new .Rmd file using the papaja template (or modify this one)
  3. If you want to test if things are working, then run 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.

Documenting data

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

The rest is where the APA paper would go

Methods

If this was an APA paper, method section would go here.

Participants

Stuff about participants would go here.

Material

Description of materials for the experiment would go here.

Procedure

Description of procedure goes here.

Data analysis

We used R (Version 3.4.2; R Core Team 2017) and the R-package papaja (Version 0.1.0.9842; Aust and Barth 2018) for all our analyses. This line is from the papaja template.

Results

Some analyses might go here.

Discussion

Discussion etc.

References

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/.