Image of the R environment required to run the SPARS data analysis scripts.
346
A dockerfile to create an image of the R environment required to run the SPARS data analysis scripts (kamermanpr/SPARS).
The image is built using the rocker/verse image of base R v3.5.1, and includes RStudio server, the TinyTex Latex distribution, the tidyverse suite of R packages (with dependencies), and several R packages (with dependencies) that are required to run the markdown scripts in SPARS. CRAN packages were installed from MRAN using the 2018-10-03 snapshot for R v3.5.1. The only package installed from GitHub (thomasp85/patchwork) was locked to the 22 September 2018 commit: fd7958bae3e7a1e30237c751952e412a0a1d1242.
These instructions are for running the analysis on your local machine.
You need to have Docker installed on your computer. To do so, go to docker.com and follow the instructions for downloading and installing Docker for your operating system. Once Docker has been installed, follow the steps below, noting that Docker commands are entered in a terminal window (Linux and OSX/macOS) or command prompt window (Windows). Windows users also may wish to install GNU Make (required for the make method of running the scripts) and Git version control software (not essential).
Enter: docker pull kamermanpr/docker-spars:v1.1.2
Download the compressed zip file from GitHub (kamermanpr/SPARS, or from figshare (DOI: 10.6084/m9.figshare.6561743).
Enter: docker run --name spars -d -p 8787:8787 -e USER=user -e PASSWORD=password kamermanpr/docker-spars:v1.1.2
Open a web browser window and navigate to: localhost:8787
Use the following login credentials:
On the Files tab in the bottom right panel of RStudio, click on the 'Upload' button, navigate to the downloaded zip file, and upload the file (it will self extract).
The SPARS directory comes with the outputs for all the analysis scripts in the /outputs directory (html and md formats). However, should you wish to run the scripts yourself, there are several preparatory steps that are required:
Acquire the data. The data required to run the scripts have not been included in the repo because participants in the studies did not consent to public release of their data. However, the data are available on request from Tory Madden ([email protected]) or Peter Kamerman ([email protected]). We will send you a zip file with the data.
Using the directory tree in the Files tab of RStudio, open the SPARS directory. Repeat the upload procedure described above, but upload the zipped data file we supplied you with into the SPARS directory.
In the SPARS directory, double-click on the SPARS.Rproj file, and follow the prompts (RStudio with reload).
Clean the /outputs and /figures directories by entering make clean in the Terminal tab in bottom right panel of RStudio.
To run all the scripts (including the data cleaning scripts), enter make in the Terminal tab.
To run individual RMarkdown scripts (*.Rmd files)
make data-cleaned/SPARS_A.rds and then make data-cleaned/SPARS_B.rds in the Terminal tab;source('0A-clean-data.R') and then source('0B-clean-data.R') in the Console tab in bottom left panel of RStudio.make outputs/<NAME_OF_INPUT_FILE>.html in the Terminal tab;Once done, log out of RStudio and enter the following into a terminal to stop the Docker container: docker stop spars. If you then want to remove the container, enter: docker rm spars. If you also want to remove the Docker image you downloaded, enter: docker rmi kamermanpr/docker-spars:v1.1.2
Content type
Image
Digest
Size
988.9 MB
Last updated
almost 8 years ago
docker pull kamermanpr/docker-spars:v1.1.2