prereg: R Markdown Templates for Preregistrations of Scientific Studies

CRAN/METACRAN Download counter Project Status: Active - The project has reached a stable, usable state and is being actively developed. GitHub last commit Travis build status GitHub bug issues

prereg provides R Markdown templates that facilitates authoring preregistrations of scientific studies in PDF format.

If you experience any problems or have suggestions for improvements, please open an issue.


Software requirements

prereg depends on additional software, namely,

  1. R 2.11.1 or later and
  2. pandoc 1.19 or later
  3. TeX 2013 or later.

If you work with RStudio (1.1.453 or later) pandoc should already be installed, otherwise refer to the installation instructions for your operating system.

Setting up a TeX distribution

prereg can be used with common TeX distributions, such as MikTeX on Windows, MacTeX on Mac, or TeX Live on Linux.

If you mainly use TeX to render R Markdown documents, we strongly recommend using the TinyTex distribution. It is lightweight and automatically installs missing LaTeX packages and can be installed from within R with .

if(!"tinytex" %in% rownames(installed.packages())) install.packages("tinytex")


Install prereg

You can install the stable version of prereg from CRAN


or the development version from this GitHub repository (you may have to install the remotes package first).

if(!"remotes" %in% rownames(installed.packages())) install.packages("remotes")

Create a preregistration document

Once you have installed the prereg you can select the templates when creating a new R Markdown file through the RStudio menus.


prereg produces a clean form-like document.

The template file contains comments that provide further details on how to fill in the form but are invisible in the final PDF document.

Using prereg without RStudio

If you want to use prereg without RStudio you can use the rmarkdown::render function to create preregistration documents:

# Create new COS preregistration challenge R Markdown file
  , "cos_prereg"
  , package = "prereg"
  , create_dir = FALSE
  , edit = FALSE

# Render document

Uploading your preregistration

After knitting your preregistration to a PDF file using this package, you may upload this protocol to a trustworthy repository to complete your preregistration. Possible repositories for this are:

Package dependencies


The preregistration templates collected in this package were developed by others (cited below and in the template documentation). We are grateful for their permission to use their material in this package.

Bosnjak, M., Fiebach, C. J., Mellor, D., Mueller, S., O’Connor, D. B., Oswald, F. L., & Sokol-Chang, R. I. (2021). A template for preregistration of quantitative research in psychology: Report of the joint psychological societies preregistration task force. American Psychologist. doi: 10.1037/amp0000879

Brandt, M. J., IJzerman, H., Dijksterhuis, A., Farach, F. J., Geller, J., Giner-Sorolla, R., … van ’t Veer, A. (2014). The Replication Recipe: What makes for a convincing replication? Journal of Experimental Social Psychology, 50, 217–224.

Crüwell, S. & Evans, N. J. (2021). Preregistration in diverse contexts: a preregistration template for the application of cognitive models. Royal Society Open Science. 8:210155

Flannery, J. E. (2020, October 22). fMRI Preregistration Template. Retrieved from

van ’t Veer, A. E., & Giner-Sorolla, R. (2016). Pre-registration in social psychology—A discussion and suggested template. Journal of Experimental Social Psychology, 67, 2–12.