Code repostitory to run analyses and generate figures and manuscript for Nitta et al. "Ecophysiological differentiation between life stages in filmy ferns (Hymenophyllaceae)". (preprint)
All code is in R. The targets package is used to manage the workflow.
To run all analyses and generate the manuscript:
- Clone this repository
- Download and unzip the data
- Run
targets::tar_make()
in the provided docker container
For each of the links below, click on "Download Dataset" or "Download all", then place the zipped data file in the data
folder of this repo. You can manually unzip the data archives if you want to see the contents, but the code needs the original zipped file in data/
to run.
- https://doi.org/10.6084/m9.figshare.14184572
- https://doi.org/10.5061/dryad.df59g
- https://doi.org/10.5061/dryad.fqz612jps
The analysis code 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. You can install docker from here.
Navigate to the cloned repository (where /path/to/repo
is the path on your machine):
cd /path/to/repo
Unzip the data:
docker run --rm -v ${PWD}:/tmpdir -w /tmpdir joelnitta/moorea_filmies:1.0.0 Rscript R/unzip_data.R
Run targets::tar_make()
:
docker run --rm -v ${PWD}:/tmpdir -w /tmpdir joelnitta/moorea_filmies:1.0.0 Rscript -e 'targets::tar_make()'
You will see the targets being built by targets
. The final manuscript should be compiled at the end as manuscript.docx
(MS for journal submission) and moorea_filmies_preprint.pdf
(preprint PDF) in the results/ms
folder. Other figure and table files will also be compiled. Supplemental information will be written to the results/si
folder.
If you want to interact with the code in the Docker container, you can launch the container in the background using docker-compose
:
docker-compose up -d
Navigate to http://localhost:8787/ in your browser of choice (firefox or google chrome recommended). There, you should be able to access an instance of the RStudio IDE, which can be used to inspect and manipulate objects in R. You can click on "Build All" in the "Build" tab to run the workflow.
When you're done, take down the container:
docker-compose down
- All code in this repository is licensed under the MIT license
- The Roboto font is licensed under the Apache 2.0 license