Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikVogel authored Dec 10, 2019
1 parent c0bd392 commit 9c454ee
Showing 1 changed file with 71 additions and 5 deletions.
76 changes: 71 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,36 @@ The **codebook** for the data can be found here: https://dominikvogel.github.io/

A **long-term archived** version of the data and code is available at XXX

There is a **Code Ocean Capsule** for long-term computational reproducibility: XXX
There is a **Code Ocean Capsule** for long-term computational reproducibility: https://doi.org/10.24433/CO.2463564.v1. See below for more information.

This **GitHub repository** provides another way to computationally reproduce the results using [Binder][1]. See below for more information.


# Reproducibility

## Using Binder

You can reproduce our results and even test how changes in the code affect the results by using the [Binder][3] environment of the paper:

1. Click on the "Launch Binder" badge
2. Wait for the server to be started
3. Open `code/Paper.Rmd` in the right panel
4. Click on `Knit` -> `Knit to pdf_document2`
5. Wait for a complete reproduction of the paper with all results.

## Using Code Ocean

You can easily reproduce our results using the free service of [Code Ocean][2]:

1. Open the paper's Code Ocean Capsule:
2. Click *Reproducible Run*
3. Code Ocean runs a virtual environment and produces a PDF with the full paper including all results.
1. Open the paper's Code Ocean Capsule: https://doi.org/10.24433/CO.2463564.v1
2. Log-in to Code Ocean
3. Click *Re-Run*
4. Code Ocean runs a virtual environment and produces a PDF with the full paper including all results.


You can inspect the *R* code by clicking on the files in the left panel (see below for an explanation of the file structure).

## On your own machine
## On your own machine (using your own *R* installation)

If you want to reproduce our results on your own computer you need *R* (we used version 3.5.3) and RStudio.

Expand All @@ -38,6 +52,22 @@ If you want to reproduce our results on your own computer you need *R* (we used
4. *R* runs all analyses and creates the full paper as a PDF document.


## On your own machine (using Docker)

1. Install Docker Community Edition
2. Download the `Docker-Capsule.zip` file and extract it
3. Open Terminal and go to extracted folder
4. Execute the following command:
```shell
docker load --input micro-intervention.tar
docker run --rm \
--workdir /code \
--volume "$PWD/data":/data \
--volume "$PWD/code":/code \
--volume "$PWD/results":/results \
micro-intervention run
```

# File structure

The repository consists of some files in the root folder and two folders.
Expand Down Expand Up @@ -65,5 +95,41 @@ The repository consists of some files in the root folder and two folders.
* `forestplot_combined.pdf`: Figure 5 (merge of figures created by `Paper_forestplot_prosocial.R` and `Paper_forestplot_societal.R`



# Required R packages

* apaTables
* BayesFactor
* bookdown
* broman
* cowplot (<= 0.9.4)
* dplyr
* effsize
* ez
* forestplot
* ggsignif
* here
* knitr
* MBESS
* nlme
* psych
* rlang
* rmarkdown
* sjstats
* stargazer
* stats
* tibble
* tidyverse
* weights
* xtable

It is advised to use `R` version 3.5.3 with the `checkpoint` package and set the date to 2019-04-01 to ensure that the package versions are comparable:

```R
library(checkpoint)
checkpoint("2019-04-01")
```

[1]: https://mybinder.org
[2]: https://codeocean.com
[3]: https://mybinder.org

0 comments on commit 9c454ee

Please sign in to comment.