Commit e4102ad6 authored by Kunstler Georges's avatar Kunstler Georges
Browse files

progress on rev2 ED table

parent fee1f548
......@@ -306,7 +306,7 @@ fun.generate.pred.param.kikj.dat <- function(list.sd, Tf.low,
print(mean.sumBn)
seq.Tf <- seq(from = Tf.low, to = Tf.high, length.out = N.pred)
if(!intra.TF){
df <- data.frame('logG' = rep(0 , N.pred),
'logD' = rep(D.mean, N.pred),
......@@ -530,7 +530,7 @@ easyPredCI.param <- function(list.res, type, newdata, alpha=0.05,alpha_0 = 'sumB
X[, !colnames(X) %in% sel.keep] <- 0
if (type == 'alpha0'){
X[, colnames(X) == alpha_0] <- 1
}
}
pred <- X %*% beta
pred.se <- sqrt(diag(X %*% V %*% t(X))) ## std errors of predictions
## inverse-link (logistic) function: could also use plogis()
......@@ -1541,10 +1541,13 @@ fun.plot.all.param <- function(list.res,
col.vec = fun.col.param(),
MAT.MAP.TF = FALSE,
intra.TF = FALSE,
ylim.list = list(maxG = c(-0.75, 0.75), alphae = c(-0.02, 0.009),
alphar = c(-0.013, 0.013), alphal = c(-0.017, 0.007),
alpha0 = c(0.003, 0.016), alpha0.intra = c(0.025, 0.32),
alpha0.inter = c(0.025, 0.32))
ylim.list = list(maxG = c(-0.75, 0.75),
alphae = c(-0.02, 0.012),
alphar = c(-0.013, 0.014),
alphal = c(-0.017, 0.007),
alpha0 = c(0.003, 0.016),
alpha0.intra = c(0.025, 0.335),
alpha0.inter = c(0.025, 0.335))
){
traits <- c('Wood.density', 'SLA', 'Max.height')
......@@ -1613,7 +1616,7 @@ if(t == 'Wood density'){
if(p == 'maxG'){
fun.plot.param.tf(df = df.t,
p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
traits_letters = traits_letters,
xlab = traits.exp[[t]],
labels.x = TRUE, labels.y = TRUE,
col.vec = col.vec,
......@@ -1623,7 +1626,7 @@ if(p == 'maxG'){
if(p == 'alpha0.inter'){
fun.plot.param.tf(df = df.t,
p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
traits_letters = traits_letters,
xlab = NA,
labels.x = FALSE, labels.y = FALSE,
col.vec = col.vec,
......@@ -1631,7 +1634,7 @@ if(p == 'maxG'){
}else{
fun.plot.param.tf(df = df.t,
p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
traits_letters = traits_letters,
xlab = NA,
labels.x = FALSE, labels.y = TRUE,
col.vec = col.vec,
......@@ -1645,7 +1648,7 @@ if(p == 'maxG'){
if(p == 'maxG'){
fun.plot.param.tf(df = df.t,
p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
traits_letters = traits_letters,
xlab = traits.exp[[t]],
labels.x = TRUE, labels.y = FALSE,
col.vec = col.vec,
......@@ -1656,7 +1659,7 @@ if(p == 'maxG'){
if(p == 'alpha0.inter'){
fun.plot.param.tf(df = df.t,
p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
traits_letters = traits_letters,
xlab = NA,
labels.x = FALSE, labels.y = FALSE,
col.vec = col.vec,
......@@ -1665,7 +1668,7 @@ if(p == 'maxG'){
}else{
fun.plot.param.tf(df = df.t,
p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
traits_letters = traits_letters,
xlab = NA,
labels.x = FALSE, labels.y = FALSE,
col.vec = col.vec,
......@@ -1692,9 +1695,12 @@ fun.plot.trade.param <- function(list.res,
col.vec = fun.col.param(),
MAT.MAP.TF = FALSE,
intra.TF = FALSE,
ylim.list = list(maxG = c(-0.75, 0.75), alphae = c(-0.02, 0.009),
alphar = c(-0.013, 0.013), alphal = c(-0.017, 0.007),
alpha0 = c(0.003, 0.016), alpha0.intra = c(0.003, 0.028),
ylim.list = list(maxG = c(-0.75, 0.75),
alphae = c(-0.02, 0.012),
alphar = c(-0.013, 0.013),
alphal = c(-0.017, 0.007),
alpha0 = c(0.003, 0.016),
alpha0.intra = c(0.003, 0.028),
alpha0.inter = c(0.003, 0.028))
){
traits <- c('Wood.density', 'SLA')
......@@ -2151,10 +2157,11 @@ names(col.vec) <- c("rho","kikj", 'GiGj')
traits_letters <- matrix(letters[1:3],
nrow = 1, ncol = 3)
colnames(traits_letters) <- c('Wood density', 'Specific leaf area', 'Maximum height')
colnames(traits_letters) <- c('Wood density', 'Specific leaf area',
'Maximum height')
rownames(traits_letters) <- 'rho'
for (t in c('Wood density', 'Specific leaf area', 'Maximum height')){
for (p in c('rho')){
df.t <- data.param[data.param$traits == t, ]
......@@ -2177,21 +2184,27 @@ if(t == 'Maximum height'){
if(t == 'Wood density'){
fun.plot.param.tf(df = df.t,
p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
ylim = range(filter(df.t,
traits_letters = traits_letters,
ylim = c(min(filter(df.t,
param.type == p)%>% select(upr,lwr)),
max(filter(df.t,
param.type == p)%>% select(upr,lwr))),
labels.x = TRUE, labels.y = TRUE,
xlab = expression(paste(Delta, ' Wood density (mg m', m^-3, ')')),
xlab = expression(paste(Delta,
' Wood density (mg m', m^-3, ')')),
col.vec = col.vec,
expr.param = expr.p.vec[p], cex.lab = 1.1, cex.axis =0.85, cex = 1)
expr.param = expr.p.vec[p], cex.lab = 1.1,
cex.axis =0.85, cex = 1)
}
if(t == 'Specific leaf area'){
fun.plot.param.tf(df = df.t,
p= p, t = t, names.param = names.param,
traits_letters = traits_letters,
ylim = range(filter(df.t,
traits_letters = traits_letters,
ylim = c(min(filter(df.t,
param.type == p)%>% select(upr,lwr)),
0.025+max(filter(df.t,
param.type == p)%>% select(upr,lwr))),
xlab = expression(paste(Delta, ' Specific leaf area (m', m^2, ' m', g^-1, ')')),
labels.x = TRUE, labels.y = TRUE,
col.vec = col.vec,
......@@ -2201,9 +2214,11 @@ if(t == 'Specific leaf area'){
if(t == 'Maximum height'){
fun.plot.param.tf(df = df.t,
p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
ylim = range(filter(df.t,
traits_letters = traits_letters,
ylim = c(min(filter(df.t,
param.type == p)%>% select(upr,lwr)),
0.02+max(filter(df.t,
param.type == p)%>% select(upr,lwr))),
labels.x = TRUE, labels.y = TRUE,
xlab = expression(paste(Delta, ' Maximum height (m)')),
col.vec = col.vec,
......
all: paper_all.pdf SupplMat.pdf extended_data.pdf paper.docx extended_method.docx SupplMat.docx
paper_all.pdf: paper.pdf extended_method.pdf
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ paper.pdf extended_method.pdf
paper_all.pdf: paper.pdf extended_data.pdf
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ paper.pdf extended_data.pdf
paper.pdf: paper.tex ms.sty references.bib
xelatex $<
bibtex paper
xelatex paper.tex
xelatex paper.tex
rm paper.log paper.out paper.aux paper.bbl paper.blg
paper_ED.pdf: paper_ED.tex ms.sty references.bib
xelatex $<
xelatex paper_ED.tex
ED_Table4.pdf: ED_Table4.tex
xelatex $<
paper.docx: paper.tex include.tex references.bib
pandoc -s -S $< --csl=nature.csl --filter pandoc-citeproc --bibliography=references.bib --template=include.tex --variable mainfont="Times New Roman" --variable sansfont=Arial --variable fontsize=12pt -s -o paper.docx
......@@ -24,19 +30,13 @@ extended_method.docx: extended_method.tex include.tex references.bib
pandoc -s -S $< --csl=nature.csl --filter pandoc-citeproc --bibliography=references.bib --template=include.tex --variable mainfont="Times New Roman" --variable sansfont=Arial --variable fontsize=12pt -o $@
extended_data.md: extended_data.R include.tex references.bib
Rscript -e "library(sowsear); sowsear('extended_data.R', 'Rmd')"
Rscript -e "library(knitr); knit('extended_data.Rmd', output = 'extended_data.md')"
extended_data.tex: extended_data.md include.tex references.bib
pandoc extended_data.md --csl=nature.csl --filter pandoc-citeproc --bibliography=references.bib --standalone --template=include.tex --variable mainfont="Times New Roman" --variable sansfont=Arial --variable fontsize=12pt --latex-engine=xelatex -o $@
extended_data.pdf: extended_data.tex include.tex references.bib
extended_data.pdf: extended_data.tex include.tex
xelatex $<
bibtex extended_data
xelatex extended_data.tex
xelatex extended_data.tex
rm extended_data.log extended_data.out extended_data.aux extended_data.bbl extended_data.blg
extended_data.docx: extended.tex include.tex references.bib
pandoc -s -S $< --csl=nature.csl --filter pandoc-citeproc --bibliography=references.bib --template=include.tex --variable mainfont="Times New Roman" --variable sansfont=Arial --variable fontsize=12pt -s -o $@
SupplMat.pdf: Suppl_Mat.Rmd include.tex references.bib
......
% Supplementary Information
## Details on data sets used
# Details on data sets used
Two main data types were used: national forest inventories -- NFI, large permanent plots -- LPP.
......
......@@ -11,12 +11,8 @@
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
% \usepackage{setspace}
% \doublespacing
% \usepackage{lineno}
% \modulolinenumbers[5]
% \linenumbers
\renewcommand{\figurename}{Extended Data Figure}
\renewcommand{\tablename}{Extended Data Table}
% use microtype if available
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
......@@ -78,7 +74,7 @@
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\setcounter{secnumdepth}{0}
%% FROM https://github.com/humburg/reproducible-reports/blob/master/include/report.latex
%% \author{}
\date{}
......@@ -87,20 +83,21 @@
\section{Extend data}\label{extend-data}
\begin{figure}[htbp]
\newpage
\clearpage
\begin{figure}
\centering
\includegraphics{../../figs/world_map.pdf}
\caption{\textbf{Map of the plot locations of all data sets analysed.}
LPP plots are represented with a large points and NFI plots with small
points (The data set of Panama comprises both a 50ha plot and a network
of 1ha plots). World map is from the R package
rworldmap\protect\footnotemark.}
of 1ha plots). The world map is from the R package
\textit{rworldmap} using Natural Earth data.}
\end{figure}
\footnotetext{South, A. Rworldmap: A new r package for mapping global data. The R Journal 3, 35–43 (2011).}
\newpage
\section{Data description}\label{data-description}
\clearpage
\begin{longtable}[c]{@{}lrrrrr@{}}
\caption{\textbf{Trees data description.} For each site is given the
......@@ -404,6 +401,9 @@ Central African Republic
\bottomrule
\end{longtable}
\newpage
\clearpage
\begin{longtable}[c]{@{}lrrr@{}}
\caption{\textbf{Traits data description.} The coverage in each site is
given with the percentage of species with species level trait
......@@ -609,11 +609,11 @@ Central African Republic
\bottomrule
\end{longtable}
\subsection{Species traits
correlation}\label{species-traits-correlation}
\newpage
\clearpage
\begin{longtable}[c]{@{}cccc@{}}
\caption{\textbf{Pairwise functional trait correlations}. Pearson's r
\caption{\textbf{Species traits pairwise correlations}. Pearson's r
correlations for the three traits.}\tabularnewline
\toprule
\begin{minipage}[b]{0.23\columnwidth}\centering\strut
......@@ -683,8 +683,6 @@ Max height
\newpage
\section{Model results}\label{model-results}
\begin{figure}[htbp]
\centering
\includegraphics{../../figs/figres4b_TP_intra.pdf}
......@@ -692,9 +690,9 @@ Max height
competition, trait dissimilarity (\(|t_f - t_c| \, \alpha_d\)),
competitive effect (\(t_c \, \alpha_e\)), tolerance to competition
(\(t_f \, \alpha_t\)) and maximum growth (\(t_f \, m_1\)) with wood
density (respectively a, b, c, d and e), specific leaf area
(respectively f, g, h, i and j) and maximum height (respectively k, l,
m, n and o).} Trait varied from their quantile at 5\% to their quantile
density (respectively \textbf{a, b, c, d} and \textbf{e}), specific leaf area
(respectively \textbf{f, g, h, i} and \textbf{j}) and maximum height (respectively \textbf{k, l,
m, n} and \textbf{o}).} Trait varied from their quantile at 5\% to their quantile
at 95\%. The shaded area represents the 95\% confidence interval of the
prediction (including uncertainty associated with \(\alpha_0\) or
\(m_0\)). \(\alpha_{0 \, intra}\) and \(\alpha_{0 \, inter}\), which do
......@@ -702,13 +700,17 @@ not vary with traits are represented with their associated confidence
intervals.}
\end{figure}
\newpage
\clearpage
\begin{figure}[htbp]
\centering
\includegraphics{../../figs/rho_set_TP_intra.pdf}
\caption{\textbf{Average difference between interspecific and
intraspecific competition predicted with estimates of trait-independent
and trait-dependent processes influencing competition for models fitted
for wood density (a), specific leaf area (b) or maximum height (c).} The
with wood density (\textbf{a}), specific leaf area (\textbf{b}) or maximum height (\textbf{c}).} The
average differences between interspecific and intraspecific competition
are influenced by \(\alpha_{0 \, intra}\), \(\alpha_{0 \, inter}\) and
\(\alpha_d\) coefficients (see Extended Methods for details). Negative
......@@ -716,18 +718,26 @@ value indicates that intraspecific competition is stronger than
interspecific competition.}
\end{figure}
\newpage
\clearpage
\begin{figure}[htbp]
\centering
\includegraphics{../../figs/figres12_TP.pdf}
\caption{\textbf{Trait-dependent and trait-independent effects on
maximum growth and competition across the globe and their variation
among biomes for models without separation of \(\alpha_0\) between intra
and interspecific competition for wood density (a), specific leaf area
(b) and maximum height (c).} See Figure 2 in the main text for
and interspecific competition for wood density (\textbf{a}), specific leaf area
(\textbf{b}) and maximum height (\textbf{c}).} See Figure 2 in the main text for
parameters description and see Fig 1a in the main text for biome
definition.}
\end{figure}
\newpage
\clearpage
\begin{longtable}[c]{@{}lrrr@{}}
\caption{\textbf{Standardized coefficient estimates from models fitted
for each traits.} Estimates and standard error (in bracket) estimated
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment