This repository hosts raw data and code required to completely reproduce the statistical analyses. All code is in
R
. The targets package was used to manage the workflow.
The statistical anlyses requires various packages to be installed, and may not work properly if package versions have changed. Therefore, a Docker image is provided to run the code reproducibly.
If you already have docker installed
- Run the following in a terminal (substituting in a user name and password):
docker run -d -p 8787:8787 -e USER=<user> -e PASSWORD=<password> awconway/TROOPS-reliability
- Open a web browser and go to: localhost:8787
- Enter your username and password to enter an RStudio session.
- Create a new project from version control (File > New project > Version Control > Git > https://github.com/awconway/TROOPS-reliability.git )
- Run this line of code in the console to reproduce the analysis:
targets::tar_make()
You will see the targets being built by targets
, and the final manuscript should be compiled at the end as manuscript.docx
.
Instead of installing docker on your system you can run it on a remote server, such as Digital Ocean. This link provides you with $100 free credit to use for a 60-day period. After signing up, follow these steps to run this project on a Digital Ocean droplet:
-
Create a DigitalOcean droplet. Choose a server with Docker installed from the Marketplace menu and choose a size for your server (number of CPUs and amount of RAM).
-
Select
User data
from theSelect additional options
section and enter the text as displayed below (substituting in a username and password).
#cloud-config
runcmd:
- docker run -d -p 8787:8787 -e USER=<user> -e PASSWORD=<password> awconway/TROOPS-reliability
-
Create the droplet.
-
Wait a few minutes for the docker image to load into the server then open a web browser and type in the ip address of the droplet you just created followed by the port 8787 (e.g. ipaddress:8787).
-
Enter your username and password to enter an RStudio session.
-
Create a new project from version control (File > New project > Version Control > Git > https://github.com/awconway/TROOPS-reliability.git )
-
Run this line of code in the console to reproduce the analysis:
targets::tar_make()
You will see the targets being built by targets
, and the final manuscript should be compiled at the end as manuscript.docx
folder.
- Destroy the DigitalOcean droplet when finished inspecting the analyses.