This repository contains all the code used in the manuscript:
- Title: "On the link between functional traits and growth rate: meta-analysis shows effects change with plant size, as predicted"
- Authors: Anais Gibert, Emma F. Gray, Mark Westoby, Ian J. Wright, and Daniel S. Falster,
- Year of publication: published
- Journal: Journal of Ecology
- doi: 10.1111/1365-2745.12594
The literature is inconsistent about empirical correlations between functional traits and plant growth rate (GR), casting doubt on the capacity of traits to predict growth. Traits should influence growth in a size-dependent manner. We outline mechanisms and hypotheses based on new theory, and test these predictions for five traits using a meta-analysis of 108 studies (> 500 correlations). Results were consistent with predictions. Specific leaf area was correlated with GR in small but not large plants. Correlations of GR with wood density and assimilation rate were not affected by size. Maximum height and seed mass were correlated with GR only in one plant size category. We show that correlations between traits and GR change in a predictable way as a function of plant size. Our understanding of plant strategies should shift away from attributing slow vs fast growth to species throughout life, in favour of attributing growth trajectories.
This repository contains all the code and data needed to rerun the analyses presented. A copy of the data has also been archived in Datadryad at doi:10.5061/dryad.701q8.
Files included in the repository here include:
data/
: Raw dataCompileData.csv
: raw data, needed to run the analysesCompileData_meta.csv
: definition of columns indata/ComplieData.csv
R
directory containing functions used in analysisms
directory containing manuscript in LaTeX and accompanying style filesreferences/
: bibtex files with references -complete.bib
: references used in the meta-analyses and in the manuscriptmeta-analyses.bib
: references used in the meta-analysesread.bib
: all references read to do the meta-analyses (all the studies used + studies read but discarded from our meta-analyses)
Additional accessory files are also including:
DECRIPTION
: A machine-readable compendium file containing key metadata and dependenciesLICENSE
: License for the materialsDockerfile
&.binder/Dockerfile
: files used to generate docker containers for long-term reproducibility
All analyses were done in R
, and the paper is written in LaTeX. All code needed to reproduce the submitted products is included in this repository. To reproduce this paper, run the code contained in the analysis.R
file. Figures will be output to a directory called output
and the paper and supplementary materials in the folder ms
.
The paper was written in 2016 using a version of R available at the time. With some minor updates, the code has been updated and was last seen running wild and free on R 3.6.1. You can try running it on your current version and it may work.
To ensure computational reproducibility into the future, we have also generated Docker and Binder containers, enabling you to launch a compute environment built off R 3.6.1 with all the dependencies included.
If reproducing these results on your own machine, first download the code and then install the required packages, listed under Depends
in the DESCRIPTION
file. This can be achieved by opening the Rstudio project and running:
#install.packages("devtools")
devtools::install_deps()
Then run analysis.R
.
You can launch the analysis on the web in an interactive RStudio session with the required software pre-installed. This session is hosted by binder and can be accessed by clicking on the following:
If you have Docker installed, you can recreate the compute environment as follows.
First fetch the container:
docker pull traitecoevo/growth_trait_metaanalysis
Then launch it via:
docker run --user root -v $(pwd):/home/rstudio/ -p 8787:8787 -e DISABLE_AUTH=true traitecoevo/growth_trait_metaanalysis
The code above initialises a docker container, which runs an rstudio session, which is accessed by pointing your browser to localhost:8787. For more instructions on running docker, see the info from rocker.
Note, this container does not contain the actual github repo, only the software environment. If you run the above command from within your downloaded repo, it will map the working directory as the current working directory inside the docker container.
For posterity, the docker image was built off rocker/verse:3.6.1
container via the following command, in a terminal contained within the downloaded repo:
docker build -t traitecoevo/growth_trait_metaanalysis .
and was then pushed to dockerhub (here). The image used by binder builds off this container, adding extra features needed bi binder, as described in rocker/binder.
Daniel Falster Anais Gibert Saras Windecker (help with binder and reproducibility)