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

progress on revision two

parent 9797c8f3
...@@ -305,6 +305,8 @@ fun.generate.pred.param.kikj.dat <- function(list.sd, Tf.low, ...@@ -305,6 +305,8 @@ fun.generate.pred.param.kikj.dat <- function(list.sd, Tf.low,
mean.sumBn <- 1#max(seq.sumBn) mean.sumBn <- 1#max(seq.sumBn)
print(mean.sumBn) print(mean.sumBn)
seq.Tf <- seq(from = Tf.low, to = Tf.high, length.out = N.pred) seq.Tf <- seq(from = Tf.low, to = Tf.high, length.out = N.pred)
if(!intra.TF){ if(!intra.TF){
df <- data.frame('logG' = rep(0 , N.pred), df <- data.frame('logG' = rep(0 , N.pred),
'logD' = rep(D.mean, N.pred), 'logD' = rep(D.mean, N.pred),
...@@ -341,6 +343,7 @@ fun.generate.pred.param.rho.dat <- function(list.sd, Tf.low, ...@@ -341,6 +343,7 @@ fun.generate.pred.param.rho.dat <- function(list.sd, Tf.low,
intra.TF = FALSE){ intra.TF = FALSE){
Tf.mean <- 0 Tf.mean <- 0
D.mean <- 0 D.mean <- 0
print(list.sd)
sd_sumBn.intra <- list.sd$sd.sumBn.intra sd_sumBn.intra <- list.sd$sd.sumBn.intra
sd_sumBn.inter <- list.sd$sd.sumBn.inter sd_sumBn.inter <- list.sd$sd.sumBn.inter
sd_sumBn <- list.sd$sd.sumBn sd_sumBn <- list.sd$sd.sumBn
...@@ -354,22 +357,22 @@ fun.generate.pred.param.rho.dat <- function(list.sd, Tf.low, ...@@ -354,22 +357,22 @@ fun.generate.pred.param.rho.dat <- function(list.sd, Tf.low,
df <- data.frame('logG' = rep(0 , N.pred), df <- data.frame('logG' = rep(0 , N.pred),
'logD' = rep(D.mean, N.pred), 'logD' = rep(D.mean, N.pred),
'Tf' =seq.Tf, 'Tf' =seq.Tf,
'sumBn' = rep(mean.sumBn, N.pred)/sd_sumBn, 'sumBn' = rep(mean.sumBn, N.pred),
'sumTfBn' = seq.Tf*mean.sumBn/sd_sumTfBn, 'sumTfBn' = (seq.Tf-Tf.low)*mean.sumBn,
'sumTnBn' = seq.Tf*mean.sumBn/sd_sumTnBn, 'sumTnBn' = rep(Tf.low, N.pred)*mean.sumBn,
'sumTnTfBn.abs' = abs(seq.Tf-Tf.low)* 'sumTnTfBn.abs' = abs(seq.Tf-Tf.low)*
mean.sumBn/sd_sumTnTfBn.abs) mean.sumBn)
} }
if(intra.TF){ if(intra.TF){
df <- data.frame('logG' = rep(0 , N.pred), df <- data.frame('logG' = rep(0 , N.pred),
'logD' = rep(D.mean, N.pred), 'logD' = rep(D.mean, N.pred),
'Tf' =seq.Tf, 'Tf' =seq.Tf,
'sumBn.intra' = -rep(mean.sumBn, N.pred)/sd_sumBn.intra, 'sumBn.intra' = -rep(mean.sumBn, N.pred),
'sumBn.inter' = rep(mean.sumBn, N.pred)/sd_sumBn.inter, 'sumBn.inter' = rep(mean.sumBn, N.pred),
'sumTfBn' = seq.Tf*mean.sumBn/sd_sumTfBn, 'sumTfBn' = (seq.Tf-Tf.low)*mean.sumBn,
'sumTnBn' = seq.Tf*mean.sumBn/sd_sumTnBn, 'sumTnBn' = rep(Tf.low, N.pred)*mean.sumBn,
'sumTnTfBn.abs' = abs(seq.Tf-Tf.low)* 'sumTnTfBn.abs' = abs(seq.Tf-Tf.low)*
mean.sumBn/sd_sumTnTfBn.abs) mean.sumBn)
} }
if(MAT.MAP.TF){ if(MAT.MAP.TF){
df$MAT <- rep(1,nrow(df)) df$MAT <- rep(1,nrow(df))
...@@ -525,6 +528,9 @@ easyPredCI.param <- function(list.res, type, newdata, alpha=0.05,alpha_0 = 'sumB ...@@ -525,6 +528,9 @@ easyPredCI.param <- function(list.res, type, newdata, alpha=0.05,alpha_0 = 'sumB
alphal = c(alpha_0, "sumTnTfBn.abs"), alphal = c(alpha_0, "sumTnTfBn.abs"),
alpha0 = alpha_0) alpha0 = alpha_0)
X[, !colnames(X) %in% sel.keep] <- 0 X[, !colnames(X) %in% sel.keep] <- 0
if (type == 'alpha0'){
X[, colnames(X) == alpha_0] <- 1
}
pred <- X %*% beta pred <- X %*% beta
pred.se <- sqrt(diag(X %*% V %*% t(X))) ## std errors of predictions pred.se <- sqrt(diag(X %*% V %*% t(X))) ## std errors of predictions
## inverse-link (logistic) function: could also use plogis() ## inverse-link (logistic) function: could also use plogis()
...@@ -563,10 +569,12 @@ easyPredCI.stabl <- function(list.res, type, newdata, alpha=0.05) { ...@@ -563,10 +569,12 @@ easyPredCI.stabl <- function(list.res, type, newdata, alpha=0.05) {
newdata) newdata)
sel.keep <- switch(type , sel.keep <- switch(type ,
kikj = c('Tf', 'sumTfBn'), kikj = c('Tf', 'sumTfBn'),
GiGj.intra = c('Tf', 'sumTfBn', 'sumBn.intra','sumBn.inter','sumTnTfBn.abs'), GiGj.intra = c('Tf', 'sumTfBn', 'sumBn.intra',
'sumBn.inter','sumTnTfBn.abs'),
GiGj = c('Tf', 'sumTfBn', 'sumTnTfBn.abs'), GiGj = c('Tf', 'sumTfBn', 'sumTnTfBn.abs'),
rho = c('sumBn','sumTnTfBn.abs'), rho = c('sumBn','sumTnTfBn.abs'),
rho.intra = c('sumBn.intra','sumBn.inter','sumTnTfBn.abs')) rho.intra = c('sumBn.intra','sumBn.inter',
'sumTnTfBn.abs'))
X[, !colnames(X) %in% sel.keep] <- 0 X[, !colnames(X) %in% sel.keep] <- 0
pred <- X %*% beta pred <- X %*% beta
pred.se <- sqrt(diag(X %*% V %*% t(X))) ## std errors of predictions pred.se <- sqrt(diag(X %*% V %*% t(X))) ## std errors of predictions
...@@ -694,9 +702,9 @@ pred.res.rho$Tf <- seq(from = list.var[[1]][['ql.o']], ...@@ -694,9 +702,9 @@ pred.res.rho$Tf <- seq(from = list.var[[1]][['ql.o']],
to = list.var[[1]][['qh.o']], to = list.var[[1]][['qh.o']],
length.out = 100) - list.var[[1]][['ql.o']] length.out = 100) - list.var[[1]][['ql.o']]
pred.res.rho$param.type <- 'rho' pred.res.rho$param.type <- 'rho'
pred.res.rho$pred <- 1- exp(-pred.res.rho$pred) pred.res.rho$pred <- (-pred.res.rho$pred)
pred.res.rho$lwr <- 1 - exp(-pred.res.rho$lwr) pred.res.rho$lwr <- (-pred.res.rho$lwr)
pred.res.rho$upr <- 1 - exp(-pred.res.rho$upr) pred.res.rho$upr <- (-pred.res.rho$upr)
new.data.GiGj <- fun.generate.pred.param.kikj.dat( list.sd = list.res$list.sd, new.data.GiGj <- fun.generate.pred.param.kikj.dat( list.sd = list.res$list.sd,
Tf.low = list.var[[1]][['ql']], Tf.low = list.var[[1]][['ql']],
...@@ -710,9 +718,9 @@ pred.res.GiGj$Tf <- seq(from = list.var[[1]][['ql.o']], ...@@ -710,9 +718,9 @@ pred.res.GiGj$Tf <- seq(from = list.var[[1]][['ql.o']],
to = list.var[[1]][['qh.o']], to = list.var[[1]][['qh.o']],
length.out = 100) - list.var[[1]][['ql.o']] length.out = 100) - list.var[[1]][['ql.o']]
pred.res.GiGj$param.type <- 'GiGj' pred.res.GiGj$param.type <- 'GiGj'
pred.res.GiGj$pred <- exp(pred.res.GiGj$pred) pred.res.GiGj$pred <- (pred.res.GiGj$pred)
pred.res.GiGj$lwr <- exp(pred.res.GiGj$lwr) pred.res.GiGj$lwr <- (pred.res.GiGj$lwr)
pred.res.GiGj$upr <- exp(pred.res.GiGj$upr) pred.res.GiGj$upr <- (pred.res.GiGj$upr)
} }
...@@ -728,9 +736,9 @@ pred.res.rho$Tf <- seq(from = list.var[[1]][['ql.o']], ...@@ -728,9 +736,9 @@ pred.res.rho$Tf <- seq(from = list.var[[1]][['ql.o']],
to = list.var[[1]][['qh.o']], to = list.var[[1]][['qh.o']],
length.out = 100) - list.var[[1]][['ql.o']] length.out = 100) - list.var[[1]][['ql.o']]
pred.res.rho$param.type <- 'rho' pred.res.rho$param.type <- 'rho'
pred.res.rho$pred <- 1 - exp(-pred.res.rho$pred) pred.res.rho$pred <- (-pred.res.rho$pred)
pred.res.rho$lwr <- 1 - exp(-pred.res.rho$lwr) pred.res.rho$lwr <- (-pred.res.rho$lwr)
pred.res.rho$upr <- 1 - exp(-pred.res.rho$upr) pred.res.rho$upr <- (-pred.res.rho$upr)
new.data.GiGj <- fun.generate.pred.param.kikj.dat( list.sd = list.res$list.sd, new.data.GiGj <- fun.generate.pred.param.kikj.dat( list.sd = list.res$list.sd,
...@@ -744,9 +752,9 @@ pred.res.GiGj$Tf <- seq(from = list.var[[1]][['ql.o']], ...@@ -744,9 +752,9 @@ pred.res.GiGj$Tf <- seq(from = list.var[[1]][['ql.o']],
to = list.var[[1]][['qh.o']], to = list.var[[1]][['qh.o']],
length.out = 100) - list.var[[1]][['ql.o']] length.out = 100) - list.var[[1]][['ql.o']]
pred.res.GiGj$param.type <- 'GiGj' pred.res.GiGj$param.type <- 'GiGj'
pred.res.GiGj$pred <- exp(pred.res.GiGj$pred) pred.res.GiGj$pred <- (pred.res.GiGj$pred)
pred.res.GiGj$lwr <- exp(pred.res.GiGj$lwr) pred.res.GiGj$lwr <- (pred.res.GiGj$lwr)
pred.res.GiGj$upr <- exp(pred.res.GiGj$upr) pred.res.GiGj$upr <- (pred.res.GiGj$upr)
} }
new.data.kikj <- fun.generate.pred.param.kikj.dat( list.sd = list.res$list.sd, new.data.kikj <- fun.generate.pred.param.kikj.dat( list.sd = list.res$list.sd,
...@@ -761,9 +769,9 @@ pred.res.kikj$Tf <- seq(from = list.var[[1]][['ql.o']], ...@@ -761,9 +769,9 @@ pred.res.kikj$Tf <- seq(from = list.var[[1]][['ql.o']],
to = list.var[[1]][['qh.o']], to = list.var[[1]][['qh.o']],
length.out = 100) - list.var[[1]][['ql.o']] length.out = 100) - list.var[[1]][['ql.o']]
pred.res.kikj$param.type <- 'kikj' pred.res.kikj$param.type <- 'kikj'
pred.res.kikj$pred <- exp(pred.res.kikj$pred) pred.res.kikj$pred <- (pred.res.kikj$pred)
pred.res.kikj$lwr <- exp(pred.res.kikj$lwr) pred.res.kikj$lwr <- (pred.res.kikj$lwr)
pred.res.kikj$upr <- exp(pred.res.kikj$upr) pred.res.kikj$upr <- (pred.res.kikj$upr)
return(rbind(pred.res.rho, pred.res.kikj, pred.res.GiGj)) return(rbind(pred.res.rho, pred.res.kikj, pred.res.GiGj))
} }
...@@ -1288,8 +1296,8 @@ fun.param.descrip <- function(seq.jitter, n.param, x.line = -0.73, intra.TF = ...@@ -1288,8 +1296,8 @@ fun.param.descrip <- function(seq.jitter, n.param, x.line = -0.73, intra.TF =
y.at.2 <- 3 y.at.2 <- 3
y.at.2.la <- 2 y.at.2.la <- 2
y.at.2.lb <- 4 y.at.2.lb <- 4
} }
mtext("Trait independent", side=2, mtext("Trait independent", side=2,
at = y.at.1, at = y.at.1,
cex =1.6, cex =1.6,
...@@ -1371,6 +1379,8 @@ Var <- "Trait indep" ...@@ -1371,6 +1379,8 @@ Var <- "Trait indep"
intra <- "intra" intra <- "intra"
fun.layout() fun.layout()
b <- border.size() b <- border.size()
traits_letters <- c('a', 'b', 'c')
names(traits_letters) <- c('Wood.density', 'SLA', 'Max.height')
################################## ##################################
## model fixed biomes ## model fixed biomes
for (i in traits){ for (i in traits){
...@@ -1533,8 +1543,8 @@ fun.plot.all.param <- function(list.res, ...@@ -1533,8 +1543,8 @@ fun.plot.all.param <- function(list.res,
intra.TF = FALSE, intra.TF = FALSE,
ylim.list = list(maxG = c(-0.75, 0.75), alphae = c(-0.02, 0.009), 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), 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 = c(0.003, 0.016), alpha0.intra = c(0.025, 0.32),
alpha0.inter = c(0.003, 0.028)) alpha0.inter = c(0.025, 0.32))
){ ){
traits <- c('Wood.density', 'SLA', 'Max.height') traits <- c('Wood.density', 'SLA', 'Max.height')
...@@ -1587,6 +1597,13 @@ names.param <- c("Tf","sumTnBn", ...@@ -1587,6 +1597,13 @@ names.param <- c("Tf","sumTnBn",
names(names.param) <- c('maxG', 'alphae', 'alphar', 'alphal', 'alpha0.inter', 'alpha0.intra') names(names.param) <- c('maxG', 'alphae', 'alphar', 'alphal', 'alpha0.inter', 'alpha0.intra')
first.p <- 'alpha0.intra' first.p <- 'alpha0.intra'
} }
traits_letters <- matrix(letters[1:(3*(length(names(expr.p.vec))-1))],
nrow = length(names(expr.p.vec)) - 1, ncol = 3)
traits_letters <- rbind(traits_letters[1,], traits_letters)
colnames(traits_letters) <- c('Wood density', 'Specific leaf area', 'Maximum height')
rownames(traits_letters) <- names(expr.p.vec)
for (t in c('Wood density', 'Specific leaf area', 'Maximum height')){ for (t in c('Wood density', 'Specific leaf area', 'Maximum height')){
for (p in names(expr.p.vec)){ for (p in names(expr.p.vec)){
df.t <- data.param[data.param$traits == t, ] df.t <- data.param[data.param$traits == t, ]
...@@ -1595,7 +1612,8 @@ par(mai = fun.mai.plot.param(t, p, big.m, small.m, first.p = first.p, last.p = ' ...@@ -1595,7 +1612,8 @@ par(mai = fun.mai.plot.param(t, p, big.m, small.m, first.p = first.p, last.p = '
if(t == 'Wood density'){ if(t == 'Wood density'){
if(p == 'maxG'){ if(p == 'maxG'){
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = traits.exp[[t]], xlab = traits.exp[[t]],
labels.x = TRUE, labels.y = TRUE, labels.x = TRUE, labels.y = TRUE,
col.vec = col.vec, col.vec = col.vec,
...@@ -1604,14 +1622,16 @@ if(p == 'maxG'){ ...@@ -1604,14 +1622,16 @@ if(p == 'maxG'){
}else{ }else{
if(p == 'alpha0.inter'){ if(p == 'alpha0.inter'){
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = NA, xlab = NA,
labels.x = FALSE, labels.y = FALSE, labels.x = FALSE, labels.y = FALSE,
col.vec = col.vec, col.vec = col.vec,
expr.param = NA, cex.lab = 1.1, cex.axis =0.85, cex = 1, add = TRUE, add.ylab.TF = FALSE) expr.param = NA, cex.lab = 1.1, cex.axis =0.85, cex = 1, add = TRUE, add.ylab.TF = FALSE)
}else{ }else{
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = NA, xlab = NA,
labels.x = FALSE, labels.y = TRUE, labels.x = FALSE, labels.y = TRUE,
col.vec = col.vec, col.vec = col.vec,
...@@ -1624,7 +1644,8 @@ if(p == 'maxG'){ ...@@ -1624,7 +1644,8 @@ if(p == 'maxG'){
if(t %in% c('Specific leaf area', 'Maximum height')){ if(t %in% c('Specific leaf area', 'Maximum height')){
if(p == 'maxG'){ if(p == 'maxG'){
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = traits.exp[[t]], xlab = traits.exp[[t]],
labels.x = TRUE, labels.y = FALSE, labels.x = TRUE, labels.y = FALSE,
col.vec = col.vec, col.vec = col.vec,
...@@ -1634,7 +1655,8 @@ if(p == 'maxG'){ ...@@ -1634,7 +1655,8 @@ if(p == 'maxG'){
}else{ }else{
if(p == 'alpha0.inter'){ if(p == 'alpha0.inter'){
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = NA, xlab = NA,
labels.x = FALSE, labels.y = FALSE, labels.x = FALSE, labels.y = FALSE,
col.vec = col.vec, col.vec = col.vec,
...@@ -1642,7 +1664,8 @@ if(p == 'maxG'){ ...@@ -1642,7 +1664,8 @@ if(p == 'maxG'){
cex = 1, add =TRUE) cex = 1, add =TRUE)
}else{ }else{
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p,names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = NA, xlab = NA,
labels.x = FALSE, labels.y = FALSE, labels.x = FALSE, labels.y = FALSE,
col.vec = col.vec, col.vec = col.vec,
...@@ -1725,6 +1748,10 @@ names.param <- c("Tf","sumTnBn", ...@@ -1725,6 +1748,10 @@ names.param <- c("Tf","sumTnBn",
names(names.param) <- c('maxG', 'alphae', 'alphar', 'alphal', 'alpha0.inter', 'alpha0.intra') names(names.param) <- c('maxG', 'alphae', 'alphar', 'alphal', 'alpha0.inter', 'alpha0.intra')
first.p <- 'maxG' first.p <- 'maxG'
} }
traits_letters <- matrix(letters[1:6], nrow = 3, ncol = 2)
colnames(traits_letters) <- c('Wood density', 'Specific leaf area')
rownames(traits_letters) <- c('maxG', 'alphar', 'alphae')
for (t in c('Wood density', 'Specific leaf area')){ for (t in c('Wood density', 'Specific leaf area')){
for (p in c( 'maxG', 'alphar', 'alphae')){ for (p in c( 'maxG', 'alphar', 'alphae')){
df.t <- data.param[data.param$traits == t, ] df.t <- data.param[data.param$traits == t, ]
...@@ -1733,7 +1760,8 @@ par(mai = fun.mai.plot.param(t, p, big.m, small.m, first.p = first.p, last.p = ' ...@@ -1733,7 +1760,8 @@ par(mai = fun.mai.plot.param(t, p, big.m, small.m, first.p = first.p, last.p = '
if(t == 'Wood density'){ if(t == 'Wood density'){
if(p == 'alphae'){ if(p == 'alphae'){
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = traits.exp[[t]], xlab = traits.exp[[t]],
labels.x = TRUE, labels.y = TRUE, labels.x = TRUE, labels.y = TRUE,
col.vec = col.vec, col.vec = col.vec,
...@@ -1741,7 +1769,8 @@ if(p == 'alphae'){ ...@@ -1741,7 +1769,8 @@ if(p == 'alphae'){
cex.axis =0.85, cex = 1, ylim = ylim.list[[p]]) cex.axis =0.85, cex = 1, ylim = ylim.list[[p]])
}else{ }else{
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = NA, xlab = NA,
labels.x = FALSE, labels.y = TRUE, labels.x = FALSE, labels.y = TRUE,
col.vec = col.vec, col.vec = col.vec,
...@@ -1750,10 +1779,11 @@ if(p == 'alphae'){ ...@@ -1750,10 +1779,11 @@ if(p == 'alphae'){
} }
} }
if(t %in% c('Specific leaf area', 'Maximum height')){ if(t %in% c('Specific leaf area')){
if(p == 'alphae'){ if(p == 'alphae'){
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = traits.exp[[t]], xlab = traits.exp[[t]],
labels.x = TRUE, labels.y = FALSE, labels.x = TRUE, labels.y = FALSE,
col.vec = col.vec, col.vec = col.vec,
...@@ -1762,7 +1792,8 @@ if(p == 'alphae'){ ...@@ -1762,7 +1792,8 @@ if(p == 'alphae'){
ylim = ylim.list[[p]]) ylim = ylim.list[[p]])
}else{ }else{
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p,names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
xlab = NA, xlab = NA,
labels.x = FALSE, labels.y = FALSE, labels.x = FALSE, labels.y = FALSE,
col.vec = col.vec, col.vec = col.vec,
...@@ -1789,8 +1820,8 @@ add.alpha <- function(col, alpha=0.5){ ...@@ -1789,8 +1820,8 @@ add.alpha <- function(col, alpha=0.5){
rgb(x[1], x[2], x[3], alpha=alpha)) rgb(x[1], x[2], x[3], alpha=alpha))
} }
fun.plot.param.tf <- function(df, p, xlab, labels.x, labels.y, fun.plot.param.tf <- function(df, p, t, xlab, labels.x, labels.y,
col.vec, expr.param,names.param, col.vec, expr.param,names.param, traits_letters,
add.ylab.TF = TRUE, add.ylab.TF = TRUE,
cex.lab = 1.3, cex.axis = 1, cex.lab = 1.3, cex.axis = 1,
cex = 1.3, add = FALSE, ...){ cex = 1.3, add = FALSE, ...){
...@@ -1802,6 +1833,9 @@ if(!add){ ...@@ -1802,6 +1833,9 @@ if(!add){
xlab = xlab, ylab = NA, xlab = xlab, ylab = NA,
lwd = 3, cex.lab = cex.lab, cex.axis = cex.axis, lwd = 3, cex.lab = cex.lab, cex.axis = cex.axis,
col = col.vec[names.param[p]], type = 'l',...) col = col.vec[names.param[p]], type = 'l',...)
y.max <- par("usr")[4] - (par("usr")[4] - par("usr")[3])*0.05
x.min <- par("usr")[1] + (par("usr")[2] - par("usr")[1])*0.05
text(x.min, y.max , traits_letters[p, t], cex = 1.5, font = 2)
axis(1, labels = labels.x) axis(1, labels = labels.x)
axis(2, labels = labels.y) axis(2, labels = labels.y)
polygon(c(df.t[, 'Tf'], polygon(c(df.t[, 'Tf'],
...@@ -2106,7 +2140,7 @@ require(dplyr) ...@@ -2106,7 +2140,7 @@ require(dplyr)
layout(m, heights=hei, widths= wid ) layout(m, heights=hei, widths= wid )
expr.p.vec <- c(expression(1-rho), expr.p.vec <- c(expression(inter~italic(vs.)~intra),
expression(kappa[i]/kappa[j]), expression(kappa[i]/kappa[j]),
expression(G[i]/G[j])) expression(G[i]/G[j]))
names(expr.p.vec) <- c('rho', 'kikj', 'GiGj') names(expr.p.vec) <- c('rho', 'kikj', 'GiGj')
...@@ -2114,6 +2148,13 @@ names.param <- c("rho","kikj", 'GiGj') ...@@ -2114,6 +2148,13 @@ names.param <- c("rho","kikj", 'GiGj')
names(names.param) <- c('rho', 'kikj', 'GiGj') names(names.param) <- c('rho', 'kikj', 'GiGj')
col.vec <- c('#018571', '#a6611a', '#dfc27d') col.vec <- c('#018571', '#a6611a', '#dfc27d')
names(col.vec) <- c("rho","kikj", 'GiGj') 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')
rownames(traits_letters) <- 'rho'
for (t in c('Wood density', 'Specific leaf area', 'Maximum height')){ for (t in c('Wood density', 'Specific leaf area', 'Maximum height')){
for (p in c('rho')){ for (p in c('rho')){
df.t <- data.param[data.param$traits == t, ] df.t <- data.param[data.param$traits == t, ]
...@@ -2135,7 +2176,8 @@ if(t == 'Maximum height'){ ...@@ -2135,7 +2176,8 @@ if(t == 'Maximum height'){
if(t == 'Wood density'){ if(t == 'Wood density'){
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
ylim = range(filter(df.t, ylim = range(filter(df.t,
param.type == p)%>% select(upr,lwr)), param.type == p)%>% select(upr,lwr)),
labels.x = TRUE, labels.y = TRUE, labels.x = TRUE, labels.y = TRUE,
...@@ -2146,7 +2188,8 @@ if(t == 'Wood density'){ ...@@ -2146,7 +2188,8 @@ if(t == 'Wood density'){
if(t == 'Specific leaf area'){ if(t == 'Specific leaf area'){
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p= p, names.param = names.param, p= p, t = t, names.param = names.param,
traits_letters = traits_letters,
ylim = range(filter(df.t, ylim = range(filter(df.t,
param.type == p)%>% select(upr,lwr)), param.type == p)%>% select(upr,lwr)),
xlab = expression(paste(Delta, ' Specific leaf area (m', m^2, ' m', g^-1, ')')), xlab = expression(paste(Delta, ' Specific leaf area (m', m^2, ' m', g^-1, ')')),
...@@ -2157,7 +2200,8 @@ if(t == 'Specific leaf area'){ ...@@ -2157,7 +2200,8 @@ if(t == 'Specific leaf area'){
if(t == 'Maximum height'){ if(t == 'Maximum height'){
fun.plot.param.tf(df = df.t, fun.plot.param.tf(df = df.t,
p = p, names.param = names.param, p = p, t = t, names.param = names.param,
traits_letters = traits_letters,
ylim = range(filter(df.t, ylim = range(filter(df.t,
param.type == p)%>% select(upr,lwr)), param.type == p)%>% select(upr,lwr)),
labels.x = TRUE, labels.y = TRUE, labels.x = TRUE, labels.y = TRUE,
......
...@@ -19,15 +19,16 @@ world.map.all.sites <- function(data,add.legend=FALSE, ...@@ -19,15 +19,16 @@ world.map.all.sites <- function(data,add.legend=FALSE,
cols = fun.col.pch.set()$col.vec){ cols = fun.col.pch.set()$col.vec){
sets <- unique(data$set) sets <- unique(data$set)
type.d <- c(rep('nfi', 8), rep('lpp', 6))
names(type.d) <- sets
# new map # new map
world.map(NA, NA) world.map(NA, NA)
for(set in sets){ for(set in sets){
i <- data$set ==set i <- data$set ==set
cex = 0.4 cex = 0.3
if(sum(i) <100) if(type.d[set] == 'lpp')
cex=1.5 cex=1.1
world.map(data[i, "Lon"], data[i, "Lat"], col = cols[[set]], world.map(data[i, "Lon"], data[i, "Lat"], col = cols[[set]],
add=TRUE, cex=cex) add=TRUE, cex=cex)
} }
......
Data set name,Country,Data type,Plot size,Diameter at breast height threshold,Number of plots,Traits,Source trait data,Evidence of disturbances and succession dynamics,References,Contact of person in charge of data formatting,Comments Panama,Panama,LPP,1 to 50 ha,1 cm,42,"Wood density, SLA, and Maximum height",local,Gap disturbances are common in the large 50ha BCI plot [see @Young-1991; @Hubbell-1999; @Lobo-2014]. Hubbell et al.[@Hubbell-1999] estimated that less than 30% of the plot experienced no disturbance over a 13-year period.,"3,4,25","Plot data: R. Condit (conditr@gmail.com), Trait data: J. Wright (wrightj@si.edu)",The data used include both the 50 ha plot of BCI and the network of 1 ha plots from Condit et al. (2013). The two first censuses of BCI plot were excluded. Japan,Japan,LPP,0.35 to 1.05 ha,2.39 cm,16,"Wood density, SLA, and Maximum height",local,"The network of plot comprise 50% of old growth forest, 17% of old secondary forest and 33% of young secondary forest.",5,"Plot data: M. I. Ishihara (moni1000f_networkcenter@fsc.hokudai.ac.jp), Trait data: Y Onoda (yusuke.onoda@gmail.com)", Luquillo,Puerto Rico,LPP,16 ha,1 cm,1,"Wood density, SLA, and Maximum height",local,"The plot has been struck by hurricanes in 1989 and in 1998[@Uriarte-2009]. In addition, two-third of the plot is a secondary forest on land previously used for agriculture and logging[@Uriarte-2009].","6, 23","Plot data: J. Thompson (jiom@ceh.ac.uk) and J. Zimmerman (esskz@ites.upr.edu), Trait data: N. Swenson (swensonn@msu.edu )", M'Baiki,Central African Republic,LPP,4 ha,10 cm,10,Wood density and SLA,local,The plot network was established with three levels of harvesting and unharvested control [@Gourlet-Fleury-2013].,"7,8",G. Vieilledent (ghislain.vieilledent@cirad.fr), Fushan,Taiwan,LPP,25 ha,1 cm,1,Wood density and SLA,local,"Fushan experienced several Typhoon disturbances in 1994 with tree fall events, the main effect was trees defoliation[@Lin-2011].",9,I-F. Sun (ifsun@mail.ndhu.edu.tw), Paracou,French Guiana,LPP,6.25 ha,10 cm,15,Wood density and SLA,local,The plot network was established with three levels of harvesting and unharvested control (Herault et al. 2010).,"10,11,24","Plot data: B. Herault (bruno.herault@cirad.fr), Trait data: C. Baraloto (Chris.Baraloto@ecofog.gf)", France,France,NFI,0.017 to 0.07 ha,7.5 cm,41503,"Wood density, SLA, and Maximum height",TRY,"French forests monitored by the French National Forest Inventory experience several types of natural disturbances[@Seidl-2014] (such as wind, forest fire, and insect attacks) and harvesting. The age structure reconstructed by Vilen et al.[@Vilen-2012] shows that young forests represent a significant percentage of the forested area (see age distribution below).","12,13",G. Kunstler (georges.kunstler@gmail.com),"The French NFI is based on temporary plots, but 5 years tree radial growth is estimated with a short core. All trees with dbh > 7.5 cm, > 22.5 cm and > 37.5 cm were measured within a radius of 6 m, 9 m and 15 m, respectively. Plots are distributed over forest ecosystems on a 1x1-km grid" Spain,Spain,NFI,0.0078 to 0.19 ha,7.5 cm,49855,"Wood density, SLA, and Maximum height",TRY,"Spanish forests monitored by the Spanish National Forest Inventory experience several types of natural disturbances[@Seidl-2014] (such as wind, forest fire, and insect attacks) and harvesting. No data are available on the age structure of the plots.","14,15,16",M. Zavala (madezavala@gmail.com),"Each SFI plot included four concentric circular sub-plots of 5, 10, 15 and 25-m radius. In these sub-plots, adult trees were sampled when diameter at breast height (d.b.h.) was 7.5-12.4 cm, 12.5-22.4 cm, 22.5-42.5 cm and >= 42.5 cm, respectively." Swiss,Switzerland,NFI,0.02 to 0.05 ha,12 cm,2665,"Wood density, SLA, and Maximum height",TRY,"Swiss forests monitored by the Swiss National Forest Inventory experience several types of natural disturbances (such as wind, forest fire, fungi and insect attacks) and harvesting. The age structure reconstructed by Vilen et al.[@Vilen-2012] shows that young forests represent a significant percentage of the forested area (see age distribution below).","17,26",M. Hanewinkel & N. E. Zimmermann (niklaus.zimmermann@wsl.ch),"All trees with dbh > 12 cm and > 36 cm were measured within a radius of 7.98 m and 12.62 m, respectively." Sweden,Sweden,NFI,0.0019 to 0.0314 ha,5 cm,22904,"Wood density, SLA, and Maximum height",TRY,"Swedish forests monitored by the Swedish National Forest Inventory experience several types of natural disturbances[@Seidl-2014] (such as wind, forest fire, and insect attacks) and harvesting. The age structure reconstructed by Vilen et al.[@Vilen-2012] shows that young forests represent a significant percentage of the forested area (see age distribution below).",18,G. Stahl (Goran.Stahl@slu.se),All trees with dbh > 10 cm were measured on circular plots of 10 m radius. US,USA,NFI,0.0014 to 0.017 ha,2.54 cm,97434,"Wood density, SLA, and Maximum height",TRY,"US forests monitored by the FIA experience several types of natural disturbances (such as wind, forest fire, fungi and insects attacks) and harvesting. The age structure reconstructed by Pan et al.[@Pan-2011] shows that young forests represents a significant percentage of the forested area (see age distribution below).",19,M. Vanderwel (Mark.Vanderwel@uregina.ca),FIA data are made up of clusters of 4 subplots of size 0.017 ha for tree dbh > 1.72 cm and nested within each subplot sampling plots of 0.0014 ha for trees dbh > 2.54 cm. The data for the four subplots were pooled Canada,Canada,NFI,0.02 to 0.18 ha,2 cm,15019,"Wood density, SLA, and Maximum height",TRY,"Canadian forests monitored by the regional forest monitoring programs experience several types of natural disturbances (such as wind, forest fire, fungi and insect attacks) and harvesting. The age structure reconstructed by Pan et al.[@Pan-2011] shows that young forests represent a significant percentage of the forested area (see age distribution below).",,J. Caspersen (john.caspersen@utoronto.ca),The protocol is variable between Provinces. A large proportion of data is from the Quebec province and the plots are 10 m in radius in this Province. NZ,New Zealand,NFI,0.04 ha,3 cm,1415,"Wood density, SLA, and Maximum height",local,"New Zealand forests are experiencing disturbance by earthquake, landslide, storm, volcanic eruptions other types. According to Holdaway et al.[@Holdaway-2014] having been disturbed during their measurement interval.","20,21",D. Laughlin (d.laughlin@waikato.ac.nz),Plots are 20 x 20 m. NSW,Australia,NFI,0.075 to 0.36 ha,10 cm,30,"Wood density, and Maximum height",local,The plot network was initially established in the 60s with different levels of selection harvesting[@Kariuki-2006].,"1,2",R. M. Kooyman (robert@ecodingo.com.au) for plot and trait data,Permanents plots established by the NSW Department of State Forests or by RMK Data set name,Country,Data type,Plot size,Diameter at breast height threshold,Number of plots,Traits,Source trait data,Evidence of disturbances and succession dynamics,References,Contact of person in charge of data formatting,Comments Panama,Panama,LPP,1 to 50 ha,1 cm,42,"Wood density, SLA, and Maximum height",local,Gap disturbances are common in the large 50ha BCI plot [see @Young-1991; @Hubbell-1999; @Lobo-2014]. Hubbell et al.[@Hubbell-1999] estimated that less than 30% of the plot experienced no disturbance over a 13-year period.,"3,4,25","Plot data: R. Condit (conditr@gmail.com), Trait data: J. Wright (wrightj@si.edu)",The data used include both the 50 ha plot of BCI and the network of 1 ha plots from Condit et al. (2013). The two first censuses of BCI plot were excluded. Japan,Japan,LPP,0.35 to 1.05 ha,2.39 cm,16,"Wood density, SLA, and Maximum height",local,"The network of plot comprise 50% of old growth forests, 17% of old secondary forests and 33% of young secondary forests.",5,"Plot data: M. I. Ishihara (moni1000f_networkcenter@ fsc.hokudai.ac.jp), Trait data: Y Onoda (yusuke.onoda@gmail.com)", Luquillo,Puerto Rico,LPP,16 ha,1 cm,1,"Wood density, SLA, and Maximum height",local,"The plot has been struck by hurricanes in 1989 and in 1998[@Uriarte-2009]. In addition, two-third of the plot is a secondary forest on land previously used for agriculture and logging[@Uriarte-2009].","6, 23","Plot data: J. Thompson (jiom@ceh.ac.uk) and J. Zimmerman (esskz@ites.upr.edu), Trait data: N. Swenson (swensonn@msu.edu )", M'Baiki,Central African Republic,LPP,4 ha,10 cm,10,Wood density and SLA,local,The plot network was established with three levels of harvesting and an unharvested control [@Gourlet-Fleury-2013].,"7,8",G. Vieilledent (ghislain.vieilledent@cirad.fr), Fushan,Taiwan,LPP,25 ha,1 cm,1,Wood density and SLA,local,Fushan experienced several Typhoon disturbances in 1994 with tree fall events. The main disturbance effect was trees defoliation[@Lin-2011].,9,I-F. Sun (ifsun@mail.ndhu.edu.tw), Paracou,French Guiana,LPP,6.25 ha,10 cm,15,Wood density and SLA,local,The plot network was established with three levels of harvesting and unharvested control[@Herault-2011].,"10,11,24","Plot data: B. Herault (bruno.herault@cirad.fr), Trait data: C. Baraloto (Chris.Baraloto@ecofog.gf)", France,France,NFI,0.017 to 0.07 ha,7.5 cm,41503,"Wood density, SLA, and Maximum height",TRY,"French forests monitored by the French National Forest Inventory experienced several types of natural disturbance[@Seidl-2014] (such as wind, forest fire, and insect attacks) and harvesting. The age structure reconstructed by Vilen et al.[@Vilen-2012] shows that young forests represent a significant percentage of the forested area (see age distribution below).","12,13",G. Kunstler (georges.kunstler@gmail.com),"The French NFI is based on temporary plots, but 5 years tree radial growth is estimated with a short core. All trees with dbh > 7.5 cm, > 22.5 cm and > 37.5 cm were measured within a radius of 6 m, 9 m and 15 m, respectively. Plots are distributed over forest ecosystems on a 1x1-km grid" Spain,Spain,NFI,0.0078 to 0.19 ha,7.5 cm,49855,"Wood density, SLA, and Maximum height",TRY,"Spanish forests monitored by the Spanish National Forest Inventory experienced several types of natural disturbance[@Seidl-2014] (such as wind, forest fire, and insect attacks) and harvesting. No data are available on the age structure of the plots.","14,15,16",M. Zavala (madezavala@gmail.com),"Each SFI plot included four concentric circular sub-plots of 5, 10, 15 and 25-m radius. In these sub-plots, adult trees were sampled when diameter at breast height (d.b.h.) was 7.5-12.4 cm, 12.5-22.4 cm, 22.5-42.5 cm and >= 42.5 cm, respectively." Swiss,Switzerland,NFI,0.02 to 0.05 ha,12 cm,2665,"Wood density, SLA, and Maximum height",TRY,"Swiss forests monitored by the Swiss National Forest Inventory experienced several types of natural disturbance (such as wind, forest fire, fungi and insect attacks) and harvesting. The age structure reconstructed by Vilen et al.[@Vilen-2012] shows that young forests represent a significant percentage of the forested area (see age distribution below).","17,26",M. Hanewinkel & N. E. Zimmermann (niklaus.zimmermann@wsl.ch),"All trees with dbh > 12 cm and > 36 cm were measured within a radius of 7.98 m and 12.62 m, respectively." Sweden,Sweden,NFI,0.0019 to 0.0314 ha,5 cm,22904,"Wood density, SLA, and Maximum height",TRY,"Swedish forests monitored by the Swedish National Forest Inventory experienced several types of natural disturbance[@Seidl-2014] (such as wind, forest fire, and insect attacks) and harvesting. The age structure reconstructed by Vilen et al.[@Vilen-2012] shows that young forests represent a significant percentage of the forested area (see age distribution below).",18,G. Stahl (Goran.Stahl@slu.se),All trees with dbh > 10 cm were measured on circular plots of 10 m radius. US,USA,NFI,0.0014 to 0.017 ha,2.54 cm,97434,"Wood density, SLA, and Maximum height",TRY,"US forests monitored by the FIA experienced several types of natural disturbance (such as wind, forest fire, fungi and insects attacks) and harvesting. The age structure reconstructed by Pan et al.[@Pan-2011] shows that young forests represents a significant percentage of the forested area (see age distribution below).",19,M. Vanderwel (Mark.Vanderwel@uregina.ca),FIA data are made up of clusters of 4 subplots of size 0.017 ha for tree dbh > 1.72 cm and nested within each subplot sampling plots of 0.0014 ha for trees dbh > 2.54 cm. The data for the four subplots were pooled Canada,Canada,NFI,0.02 to 0.18 ha,2 cm,15019,"Wood density, SLA, and Maximum height",TRY,"Canadian forests monitored by the regional forest monitoring programs experienced several types of natural disturbance (such as wind, forest fire, fungi and insect attacks) and harvesting. The age structure reconstructed by Pan et al.[@Pan-2011] shows that young forests represent a significant percentage of the forested area (see age distribution below).",,J. Caspersen (john.caspersen@utoronto.ca),"Provinces included are Manitoba, New Brunswick, Newfoundland and Labrador, Nova Scotia, Ontario, Quebec and Saskatchewan. The protocol is variable between Provinces. A large proportion of data is from the Quebec province and the plots are 10 m in radius in this Province." NZ,New Zealand,NFI,0.04 ha,3 cm,1415,"Wood density, SLA, and Maximum height",local,"New Zealand forests are experiencing disturbance by earthquake, landslide, storm, volcanic eruptions, and other types. According to Holdaway et al.[@Holdaway-2014] the disturbance return interval on the plots is 63 years.","20,21",D. Laughlin (d.laughlin@waikato.ac.nz),Plots are 20 x 20 m. NSW,Australia,NFI,0.075 to 0.36 ha,10 cm,30,"Wood density, and Maximum height",local,The plot network was initially established in the 1960s with different levels of selection harvesting[@Kariuki-2006].,"1,2",R. M. Kooyman (robert@ecodingo.com.au) for plot and trait data,Permanents plots established by the NSW Department of State Forests or by RMK
\ No newline at end of file \ No newline at end of file
......
...@@ -24,11 +24,21 @@ extended_method.docx: extended_method.tex include.tex references.bib ...@@ -24,11