Leaf mass per area, not total leaf area, drives differences in above-ground biomass distribution among woody plant functional types
This repository contains code needed to reproduce the article:
Duursma RA, Falster DS, "Leaf mass per area, not total leaf area, drives differences in above-ground biomass distribution among woody plant functional types", New Phytologist (accepted 2016-04-28).
All analyses were done in R
. To compile the paper, including figures and supplementary material we use the remake package for R. You can install remake using the devtools
package:
devtools::install_github("richfitz/remake", dependencies=TRUE)
(run install.packages("devtools")
to install devtools if needed.)
The remake
package also depends on storr
, install it like this:
devtools::install_github("richfitz/storr", dependencies=TRUE)
Next you need to download this repository, and then open an R session with working directory set to the root of the project.
We use a number of packages, these can be easily installed by remake:
remake::install_missing_packages()
The above command may not install the baad.data package correctly, for that do:
devtools::install_github("richfitz/datastorr")
devtools::install_github("traitecoevo/baad.data")
Then, to generate all figures, analyses, and manuscript (PDF, using LaTeX), simply do:
remake::make()
The last step of making the pdf requires a reasonably complete LaTeX installation (e.g. MacTeX for OSX or MikTex for windows). The LaTeX compilation will depend on a few packages from CTAN, make sure to allow automatic package installation by your LaTeX distribution.
You can also decide to reproduce only the figures, to do this run:
remake::make("figures")
To make only any of the figures, run a command like
remake::make("figures/Figure1.pdf")
The list of targets can be gleaned from the file remake.yml
.
If you find remake confusing and prefer to run plain R, you can use remake to build a script build.R
that produces a given output, e.g.
remake::make_script(filename="build.R")
Many thanks to Rich FitzJohn for helping us develop this work flow.