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

start global analysis and look at shannon

parent 1bffcab2
#!/usr/bin/env Rscript
source("R/analysis/glmer.output-fun.R")
files <- list.files("output/glmer", recursive=TRUE, full.names =TRUE, pattern = "glmer.results.global.rds")
out <- lapply(files, summarise.glmer.output.list)
names(out) <- lapply(lapply(files,files.details),function(x) paste(as.vector(x[-6]),collapse="_"))
saveRDS(out,file='output/glmer.global.std.list.out.rds')
names.param <- unique(unlist(lapply(out,function(list.res) names(list.res$glmer.summary$fixed.coeff.E))))
DF.results <- do.call("rbind",lapply(out,fun.format.in.data.frame,names.param=names.param))
DF.results$id <- paste(DF.results$set,DF.results$ecocode,sep=".")
saveRDS(DF.results,file='output/glmer.global.std.DF.rds')
#!/usr/bin/env Rscript
source("R/analysis/glmer.output-fun.R")
files <- list.files("output/glmer", recursive=TRUE, full.names =TRUE, pattern = "rds")
files <- list.files("output/glmer", recursive=TRUE, full.names =TRUE, pattern = "glmer.results.rds")
out <- lapply(files, summarise.glmer.output.list)
names(out) <- lapply(lapply(files,files.details),function(x) paste(as.vector(x[-6]),collapse="_"))
saveRDS(out,file='output/glmer.list.out.rds')
......
......@@ -56,7 +56,7 @@ fun.call.glmer.and.save <- function(formula,df.lmer,path.out){
end <- Sys.time()
print(end - Start)
print(summary(glmer.output))
saveRDS(glmer.output,file=file.path(path.out, "glmer.results.no.std.rds"))
saveRDS(glmer.output,file=file.path(path.out, "glmer.results.global.rds"))
}
run.glmer <- function (model.file, trait, set, ecoregion,
......@@ -92,10 +92,10 @@ output.dir.glmer <- function (model, trait, set, ecoregion,type.filling) {
# Function to prepare data for lmer
#============================================================
load.and.prepare.data.for.glmer <- function(trait, set, ecoregion,
min.obs, sample.size, type.filling,
min.obs, sample.size, type.filling,
base.dir = "output/processed/"){
### load data
data.tree.tot <- read.csv(file.path(base.dir, set,ecoregion,"data.tree.tot.no.std.csv"), stringsAsFactors = FALSE)
data.tree.tot <- read.csv(file.path(base.dir, set,ecoregion,"data.tree.tot.global.csv"), stringsAsFactors = FALSE)
fun.data.for.glmer(data.tree.tot,trait,type.filling=type.filling)
}
......@@ -105,14 +105,14 @@ fun.select.data.for.analysis <- function(data.tree,abs.CWM.tntf,perc.neigh,BATOT
data.tree <- subset(data.tree,subset=(!is.na(data.tree[["dead"]])) &
(!is.na(data.tree[["D"]])) )
## remove tree with zero
data.tree <- subset(data.tree,subset=data.tree[["D"]]>9.9)
## select species with missing traits
data.tree <- subset(data.tree,subset=data.tree[["D"]]>9.9)
## select species with missing traits
data.tree <- data.tree[(!is.na(data.tree[[abs.CWM.tntf]]) &
!is.na(data.tree[[BATOT]])),]
# select species with minimum obs
# select species with minimum obs
data.tree <- subset(data.tree,subset=data.tree[["sp"]] %in%
names(table(factor(data.tree[["sp"]])))[table(factor(data.tree[["sp"]]))>min.obs])
# select obs abov min perc.neigh
# select obs abov min perc.neigh
data.tree <- subset(data.tree,subset=data.tree[[perc.neigh]] > min.perc.neigh & !is.na(data.tree[[perc.neigh]]))
return(data.tree)
}
......@@ -159,6 +159,7 @@ sumTnBn <- data.tree[[CWM.tn]]*data.tree[[BATOT]]
sumTfBn <- data.tree[[tf]]*data.tree[[BATOT]]
sumTnTfBn.diff <- sumTnBn-sumTfBn
sumBn <- data.tree[[BATOT]]
return(data.frame(dead=dead,
logD=logD,
species.id=species.id,
......@@ -176,12 +177,14 @@ return(data.frame(dead=dead,
# that will be used in a simple linear model
#============================================================
fun.data.for.glmer <- function(data.tree,trait,min.obs=10,type.filling='species') {
if(! trait %in% c("SLA", "Leaf.N","Seed.mass","SLA","Wood.density","Max.height")) stop("need trait to be in SLA Leaf.N Seed.mass SLA Wood.density or Max.height ")
if(! trait %in% c("SLA", "Leaf.N","Seed.mass","SLA","Wood.density","Max.height"))
stop("need trait to be in SLA Leaf.N Seed.mass SLA Wood.density or Max.height ")
# get vars names
CWM.tn <- paste(trait,"CWM",'fill',"log",sep=".")
abs.CWM.tntf <- paste(trait,"abs.CWM",'fill',"log",sep=".")
CWM.tn <- paste(trait,"CWM",'fill',sep=".")
abs.CWM.tntf <- paste(trait,"abs.CWM",'fill',sep=".")
tf <- paste(trait,"focal",sep=".")
BATOT <- "BATOT.log"
BATOT <- "BATOT"
perc.neigh <- paste(trait,"perc",type.filling,sep=".")
data.tree <- fun.select.data.for.analysis(data.tree,abs.CWM.tntf,perc.neigh,BATOT,min.obs)
#= DATA LIST FOR JAGS
......
#!/usr/bin/env Rscript
source("R/analysis/lmer.output-fun.R")
source("R/analysis/lmer.run.nolog.R")
## LOOP OVER FILES AND NOT SCAN ALL FILES
sets <- c('BCI','Canada','France','Fushan','NVS','Paracou',
'Spain','US','Swiss','Sweden','NSW','Mbaiki','Luquillo','Japan')
traits <- c("SLA", "Wood.density","Max.height","Leaf.N","Seed.mass")
type.filling <- 'species'
files <- c()
for (set in sets){
ecoregions <- get.ecoregions.for.set(set)
for (ecoregion in ecoregions){
for (trait in traits){
for (model in c(model.files.lmer.Tf.1,model.files.lmer.Tf.2)){
source(model, local = TRUE)
model.obj <- load.model()
pathout <- output.dir.lmer(model=model.obj$name, trait,
set, ecoregion,type.filling)
files <- c(files,file.path(pathout,"results.global.nolog.rds"))
}
}
}
}
out <- lapply(files, summarise.lmer.output.list)
names(out) <- lapply(lapply(files,files.details),
function(x) paste(as.vector(x[names(x) != 'file']),
collapse="_"))
### remove missing
out <- out[!unlist(lapply(out,FUN=function(x) is.null(x$lmer.summary)))]
saveRDS(out,file='output/lmer.list.out.global.std.nolog.rds')
names.param <- unique(unlist(lapply(out,
function(list.res) names(list.res$lmer.summary$fixed.coeff.E))))
DF.results <- do.call("rbind",lapply(out, fun.format.in.data.frame,
names.param = names.param))
DF.results$id <- paste(DF.results$set, DF.results$ecocode, sep=".")
saveRDS(DF.results,file='output/lmer.global.std.nolog.DF.rds')
......@@ -7,7 +7,7 @@ source("R/analysis/lmer.run.nolog.all.R")
traits <- c("SLA", "Wood.density","Max.height","Leaf.N","Seed.mass")
type.filling <- 'species'
files <- c()
for (trait in trait){
for (trait in traits){
for(model in c(model.files.lmer.Tf.1,model.files.lmer.Tf.2)){
source(model, local = TRUE)
model.obj <- load.model()
......
#!/usr/bin/env Rscript
rm(list=ls())
rm(list = ls())
source("R/analysis/lmer.output-fun.R")
source("R/utils/plot.R")
## load results
DF.results <- readRDS('output/lmer.nolog.DF.rds')
## load results all
list.all.results <- readRDS('output/list.lmer.out.nolog.all.rds')
DF.global <- do.call( 'rbind', lapply(list.all.results,fun.merge.results.global))
fun.get.genus <- function(x) gsub(paste(" ", gsub("^([a-zA-Z]* )", "", x), sep = ""),
"", x, fixed = TRUE)
DF.global$set <- unlist(lapply(DF.global$ecocode, fun.get.genus))
DF.global$id <- gsub(" ", ".", DF.global$ecocode)
## load climatic data
site.clim.all <- read.csv( file.path("output/processed", "all.sites.clim.csv"), stringsAsFactors = FALSE)
site.clim.all$id <- paste(site.clim.all$set,site.clim.all$ecocode,sep=".")
## par(mfrow=c(1,2),mar=c(5, 9, 4, 1) +0.1)
## boxplot(site.clim.all$clim.all.MAT~site.clim.all$id,horizontal=TRUE,las=2,cex.axis=0.8)
## boxplot(site.clim.all$clim.all.MAP~site.clim.all$id,horizontal=TRUE,las=2,cex.axis=0.8)
mean.MAT <- tapply(site.clim.all$clim.all.MAT,INDEX=site.clim.all$id,FUN=mean,na.rm=TRUE)
mean.MAP <- tapply(site.clim.all$clim.all.MAP,INDEX=site.clim.all$id,FUN=mean,na.rm=TRUE)
data.clim.ecocode <- data.frame(id=names(mean.MAT),MAT=mean.MAT,MAP=mean.MAP)
site.clim.all <- read.csv( file.path("output/processed", "all.sites.clim.csv"),
stringsAsFactors = FALSE)
site.clim.all$id <- paste(site.clim.all$set, site.clim.all$ecocode, sep = ".")
mean.MAT <- tapply(site.clim.all$MAT, INDEX = site.clim.all$id,
FUN = mean, na.rm = TRUE)
mean.MAP <- tapply(site.clim.all$MAP, INDEX = site.clim.all$id,
FUN = mean, na.rm = TRUE)
unique.set <- tapply(site.clim.all$set, INDEX = site.clim.all$id,
FUN = unique, na.rm = TRUE)
data.clim.ecocode <- data.frame(id = names(mean.MAT),
MAT = mean.MAT,
MAP = mean.MAP,
set = unique.set, stringsAsFactors = FALSE)
biomes.vec <- fun.overly.plot.on.biomes(MAP = data.clim.ecocode$MAP/10,
MAT = data.clim.ecocode$MAT,
names.vec = 1:nrow(data.clim.ecocode))
data.clim.ecocode$biomes <- as.character(unlist(biomes.vec))
### merge climate and lmer results
DF.results <- merge(DF.results,data.clim.ecocode,by="id")
DF.results <- merge(DF.results,
data.clim.ecocode[, c('id','MAT','MAP','biomes')] ,
by = "id")
DF.results$id2 <- paste(DF.results$id, DF.results$trait, DF.results$filling)
DF.global <- merge(DF.global,
data.clim.ecocode[, c('id','MAT','MAP','biomes')] ,
by = "id")
DF.global$id2 <- paste(DF.global$id, DF.global$trait, DF.global$filling)
## add value for NVS
DF.results$biomes[DF.results$ecocode == 'MixedCool'] <- 'temperate_rainforest'
DF.global$biomes[DF.global$ecocode == 'MixedCool'] <- 'temperate_rainforest'
## ADD percentage traits
site.perc.all <- read.csv('output/processed/all.sites.perc.traits.csv',
stringsAsFactors = FALSE)
site.perc.all$id <- paste(site.perc.all$set, site.perc.all$ecocode, sep = ".")
DF.results <- merge(DF.results,
subset(site.perc.all,
select = c('id', 'perc.gymno',
'perc.ev', 'BATOT.m')),
by = "id")
DF.global <- merge(DF.global,
subset(site.perc.all,
select = c('id', 'perc.gymno',
'perc.ev', 'BATOT.m')),
by = "id")
DF.results$id2 <- paste(DF.results$id,DF.results$trait,DF.results$filling)
### save
saveRDS(DF.results,file='output/lmer.nolog.DF.results.merged.rds')
saveRDS(DF.results, file = 'output/lmer.nolog.DF.results.merged.rds')
saveRDS(DF.global, file = 'output/lmer.nolog.DF.results.merged.global.rds')
par(mfrow = c(2, 4))
for (param in c('sumTnBn', 'sumTfBn')){
for (t in c('Wood.density', 'SLA', 'Leaf.N', 'Max.height')){
plot(DF.global[DF.global$model == 'lmer.LOGLIN.ER.Tf' &
DF.global$trait == t, 'MAP'],
DF.global[DF.global$model == 'lmer.LOGLIN.ER.Tf' &
DF.global$trait == t, param],
col = col.vec[DF.global[DF.global$model == 'lmer.LOGLIN.ER.Tf' &
DF.global$trait == t, 'set']],
xlab = 'MAP (mm)', ylab = param, log = 'x')
abline( h = 0)
}
}
DF.results <- readRDS(file = 'output/lmer.nolog.DF.results.merged.rds')
DF.results <- readRDS(file='output/lmer.nolog.DF.results.merged.rds')
### Analysis of the results
DF.R2m.diff <- do.call("rbind",lapply(1:nrow(DF.results),fun.compute.criteria.diff,DF.results,"R2m"))
DF.R2c.diff <- do.call("rbind",lapply(1:nrow(DF.results),fun.compute.criteria.diff,DF.results,"R2c"))
DF.AIC.diff <- do.call("rbind",lapply(1:nrow(DF.results),fun.compute.criteria.diff,DF.results,"AIC"))
DF.delta.AIC <- do.call("rbind",lapply(1:nrow(DF.results),fun.compute.delta.AIC,DF.results))
DF.R2m.diff <- do.call("rbind", lapply(1:nrow(DF.results),
fun.compute.criteria.diff,
DF.results, "R2m"))
DF.R2c.diff <- do.call("rbind", lapply(1:nrow(DF.results),
fun.compute.criteria.diff,
DF.results, "R2c"))
DF.AIC.diff <- do.call("rbind", lapply(1:nrow(DF.results),
fun.compute.criteria.diff,
DF.results, "AIC"))
DF.delta.AIC <- do.call("rbind", lapply(1:nrow(DF.results),
fun.compute.delta.AIC, DF.results))
DF.var.fixed <- fun.ratio.var.fixed.effect(DF.results)
DF.results <- cbind(DF.results,DF.R2m.diff,DF.R2c.diff,DF.AIC.diff,DF.delta.AIC,DF.var.fixed)
DF.results <- cbind(DF.results, DF.R2m.diff, DF.R2c.diff,
DF.AIC.diff, DF.delta.AIC, DF.var.fixed)
### report best model based on AIC
DF.best.and.all.AIC <- do.call('rbind',lapply(unique(DF.results$id2),FUN=fun.AIC,DF.results))
DF.best.and.all.AICc <- do.call('rbind',lapply(unique(DF.results$id2),FUN=fun.AICc,DF.results))
DF.best.and.all.AIC <- do.call('rbind', lapply(unique(DF.results$id2),
FUN = fun.AIC, DF.results))
DF.best.and.all.AICc <- do.call('rbind', lapply(unique(DF.results$id2),
FUN = fun.AICc, DF.results))
DF2 <- DF.results[DF.results$model %in%
c('lmer.LOGLIN.AD.Tf',
'lmer.LOGLIN.HD.Tf',
'lmer.LOGLIN.nocomp.Tf',
'lmer.LOGLIN.simplecomp.Tf'), ]
DF.best.and.all.AIC2 <- do.call('rbind', lapply(unique(DF2$id2),
FUN = fun.AIC,DF2 ))
table(DF.best.and.all.AIC[DF.best.and.all.AIC$filling=='species',]$best.model,
DF.best.and.all.AIC[DF.best.and.all.AIC$filling=='species',]$trait,
DF.best.and.all.AIC[DF.best.and.all.AIC$filling=='species',]$set)
t(table(DF.best.and.all.AIC[DF.best.and.all.AIC$filling=='species',]$best.model,
DF.best.and.all.AIC[DF.best.and.all.AIC$filling=='species',]$set))/(apply(table(DF.best.and.all.AIC[
DF.best.and.all.AIC$filling=='species',]$best.model,
DF.best.and.all.AIC[DF.best.and.all.AIC$filling=='species',]$set),
MARGIN=2,sum))
(table(DF.best.and.all.AIC[DF.best.and.all.AIC$filling == 'species', ]$best.model,
DF.best.and.all.AIC[DF.best.and.all.AIC$filling == 'species', ]$trait,
DF.best.and.all.AIC[DF.best.and.all.AIC$filling == 'species', ]$set))
t(table(DF.best.and.all.AIC[DF.best.and.all.AIC$filling == 'species', ]$best.model,
DF.best.and.all.AIC[DF.best.and.all.AIC$filling == 'species', ]$set))/
(apply(table(DF.best.and.all.AIC[DF.best.and.all.AIC$filling == 'species',
]$best.model,
DF.best.and.all.AIC[DF.best.and.all.AIC$filling == 'species', ]$set),
MARGIN=2, sum))
## AIC weights
AIC.weights <- do.call('rbind',
lapply(1:nrow(DF.best.and.all.AICc),
FUN=function(i,DF) exp((min(DF[i,])-DF[i,])/2)/sum(exp((min(DF[i,])-DF[i,])/2)),
DF.best.and.all.AIC[,9:15]))
DF.AIC.weights <- data.frame(DF.best.and.all.AICc[,1],AIC.weights)
names(DF.AIC.weights) <- c('id2',paste('AIC.weight',names(DF.AIC.weights)[-1],sep='.'))
DF.best.and.all.AIC <- merge(DF.best.and.all.AIC,DF.AIC.weights,by='id2')
AIC.weights <- do.call('rbind',
lapply(1:nrow(DF.best.and.all.AICc),
FUN=function(i, DF) exp((min(DF[i, ])-DF[i, ])/2)/
sum(exp((min(DF[i, ])-DF[i, ])/2)),
DF.best.and.all.AIC[, 9:15]))
DF.AIC.weights <- data.frame(DF.best.and.all.AICc[, 1], AIC.weights)
names(DF.AIC.weights) <- c('id2', paste('AIC.weight',
names(DF.AIC.weights)[-1],
sep = '.'))
DF.best.and.all.AIC <- merge(DF.best.and.all.AIC, DF.AIC.weights, by = 'id2')
#### compute percentage of variance explained by var
......@@ -70,19 +160,249 @@ DF.results$R.perc.var <- DF.results$sumTfBn.VAR/DF.results$sumBn.VAR
DF.results$E.perc.var <- DF.results$sumTnBn.VAR/DF.results$sumBn.VAR
DF.results$ER.perc.var <- DF.results$effect.response.var/DF.results$sumBn.VAR
## compute a global AIC
fun.global.aic <- function(DF.results){
DF.results <- DF.results[DF.results$nobs>1000, ]
# select set ecocode with more than 1000 obs
DF.results <- DF.results[DF.results$id2 %in% names(table(DF.results$id2))[
table(DF.results$id2) == 7], ]
# select set ecocode with 7 model tested
## species
DF.results.sp <- DF.results[DF.results$filling == 'species', ]
# select set ecocode with more than 1000 obs
test.same.n.model.ecoregion <- apply(table(DF.results.sp$trait,
DF.results.sp$model),
MARGIN = 1,
function(x) all(x == x[1]))
if(!all(test.same.n.model.ecoregion))
stop(paste('error not the same number of ecoregion for traits',
names(test.same.n.model.ecoregion)[!test.same.n.model.ecoregion]))
list.sp <- list(AIC.tot = tapply(DF.results.sp$AIC,
INDEX = list(DF.results.sp$trait, DF.results.sp$model),
FUN = sum),
N.ecoregion = tapply(DF.results.sp$AIC, INDEX = list(DF.results.sp$trait,
DF.results.sp$model), FUN = length))
## genus
DF.results.ge <- DF.results[DF.results$filling == 'genus', ]
# select set ecocode with more than 1000 obs
test.same.n.model.ecoregion <- apply(table(DF.results.ge$trait,
DF.results.ge$model),
MARGIN = 1,
function(x) all(x == x[1]))
if(!all(test.same.n.model.ecoregion))
stop(paste('error not the same number of ecoregion for traits',
names(test.same.n.model.ecoregion)[!test.same.n.model.ecoregion]))
list.ge <- list(AIC.tot = tapply(DF.results.ge$AIC,
INDEX = list(DF.results.ge$trait,
DF.results.ge$model),
FUN = sum),
N.ecoregion = tapply(DF.results.ge$AIC,
INDEX = list(DF.results.ge$trait, DF.results.ge$model),
FUN = length))
return(list(sp = list.sp, ge = list.ge))
}
global.AIC.list <- fun.global.aic(DF.results)
global.AIC.list$sp$AIC.tot - apply(global.AIC.list$sp$AIC.tot, MARGIN = 1, min)
#############################################
#############################################
### DO THE PLOT
models <- c('lmer.LOGLIN.ER.Tf','lmer.LOGLIN.ER.Tf')
names(models) <- c('Effect/response effect','Effect/response response')
list.params <- list(c(Response='sumTnBn'),
c(Effect='sumTfBn'))
pdf('figs/parameters.MAP.ER.all.pdf',width=9,height=7)
fun.plot.panel.lmer.parameters.c(models=models,
traits = c('Wood.density','SLA','Leaf.N','Max.height'),
DF.results,var.x='MAP',
list.params=list.params,small.bar=0.02,threshold.delta.AIC=10000)
models <- c('lmer.LOGLIN.ER.Tf', 'lmer.LOGLIN.AD.Tf')
names(models) <- c('Effect/response', 'Absolute distance')
var.y.l <- list('R2m.simplecomp', 'R2m.simplecomp')
pdf('figs/R2m.MAP.pdf', width = 12, height = 8)
fun.plot.panel.lmer.res.x.y(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'),
DF.results,
var.x = 'MAP', var.y.l = var.y.l,
ylim = c(-0.015, 0.06))
dev.off()
models <- c('lmer.LOGLIN.ER.Tf', 'lmer.LOGLIN.AD.Tf')
names(models) <- c('Effect/response', 'Absolute distance')
var.y.l <- list('effect.response.var', 'sumTnTfBn.abs.VAR')
pdf('figs/perc.var.MAP.pdf', width = 12, height = 8)
fun.plot.panel.lmer.res.x.y(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'),
DF.results,
var.x = 'MAP', var.y.l = var.y.l,
ylim = c(-0.015, 0.17))
dev.off()
models <- c('lmer.LOGLIN.ER.Tf', 'lmer.LOGLIN.ER.Tf')
names(models) <- c('Effect/response effect', 'Effect/response response')
list.params <- list(c(Response = 'sumTnBn'),
c(Effect = 'sumTfBn'))
pdf('figs/parameters.MAP.ER.all.nolog.pdf', width = 9, height = 7)
fun.plot.panel.lmer.parameters.c(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'),
DF.results, var.x = 'MAP',
list.params = list.params,
small.bar = 0.2, threshold.delta.AIC = 10000000,
ylim = c(-0.025, 0.025), ylim.same = TRUE,
log = 'x', lwd = 1.5)
dev.off()
par(mfrow = c(2, 4), mar=c(9,4,3,2))
for (i in c('Wood.density', 'SLA',
'Leaf.N', 'Max.height')) {boxplot(sumTnBn ~ biomes ,
data = fun.select.ecoregions.trait(DF.results, i,
'lmer.LOGLIN.ER.Tf', nobs.min = 1000,
filling.selected="species",
threshold.delta.AIC=100000), las = 3)
abline(h = 0, lty = 2)
}
for (i in c('Wood.density', 'SLA',
'Leaf.N', 'Max.height')) {boxplot(sumTfBn ~ biomes ,
data = fun.select.ecoregions.trait(DF.results, i,
'lmer.LOGLIN.ER.Tf', nobs.min = 1000,
filling.selected="species",
threshold.delta.AIC=100000), las = 3)
abline(h = 0, lty = 2)
}
models <- c('lmer.LOGLIN.ER.Tf')
names(models) <- c('ER effect')
list.params <- list(c(Response = 'sumTnBn'))
fun.plot.panel.lmer.parameters.c(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'),
DF.results, var.x = 'sumTfBn',
list.params = list.params,
small.bar = 0.00002, threshold.delta.AIC = 10000000,
ylim = c(-0.025, 0.025), ylim.same = TRUE,
lwd = 1.5)
models <- c('lmer.LOGLIN.HD.Tf')
names(models) <- c('HD effect')
list.params <- list(c(Response = 'sumTnTfBn.diff'))
fun.plot.panel.lmer.parameters.c(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'),
DF.results, var.x = 'MAP',
list.params = list.params,
small.bar = 0.2, threshold.delta.AIC = 10000000,
ylim = c(-0.025, 0.025), ylim.same = TRUE,
log = 'x', lwd = 1.5)
par(mfrow = c(1,2))
fun.plot.all.param.x.y.c('lmer.LOGLIN.ER.Tf', 'Wood.density', DF.results,
var.x = 'MAP', params = 'sumTnBn',
add.name = TRUE,
small.bar = 0.002, threshold.delta.AIC = 10000000,
col.vec = col.vec, col.set = TRUE,
log = 'x', ylim.same = FALSE)
abline(h = 0, lty = 2)
fun.plot.all.param.x.y.c('lmer.LOGLIN.ER.Tf', 'Wood.density', DF.results,
var.x = 'MAP', params = 'sumTnBn',
add.name = TRUE,
small.bar = 0.002, threshold.delta.AIC = 10000000,
col.vec = col.vec, col.set = TRUE,
log = 'x', ylim.same = FALSE)
abline(h = 0, lty = 2)
x11()
fun.plot.panel.lmer.parameters.c(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'),
DF.results, var.x = 'MAT',
list.params = list.params,
small.bar = 0.2, threshold.delta.AIC = 10000000,
ylim = c(-0.03, 0.03), ylim.same = TRUE)
x11()
fun.plot.panel.lmer.parameters.c(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'),
DF.results, var.x = 'perc.gymno',
list.params = list.params,
small.bar = 0.002,
threshold.delta.AIC = 10000000,
ylim = c(-0.03, 0.03), ylim.same = TRUE)
x11()
fun.plot.panel.lmer.parameters.c(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'),
DF.results, var.x = 'perc.ev',
list.params = list.params,
small.bar = 0.002,
threshold.delta.AIC = 10000000,
ylim = c(-0.03, 0.03), ylim.same = TRUE)
models <- c('lmer.LOGLIN.ER.Tf', 'lmer.LOGLIN.AD.Tf')
names(models) <- c('ER Tf', 'AD Tf')
list.params <- list(c(Response = 'Tf'),
c(Effect = 'Tf'))
fun.plot.panel.lmer.parameters.c(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'),
DF.results, var.x = 'MAP',
list.params = list.params,
small.bar = 0.2, threshold.delta.AIC = 10000000,
ylim = c(-1, 1), ylim.same = TRUE)
models <- c('lmer.LOGLIN.ER.Tf', 'lmer.LOGLIN.AD.Tf', 'lmer.LOGLIN.simplecomp.Tf')
names(models) <- c('ER Tf', 'AD Tf', 'Simple compet Tf')
list.params <- list(c(TF = 'Tf'),
c(TF = 'Tf'),
c(TF = 'Tf'))
fun.plot.panel.lmer.parameters.c(models = models,
traits = c('Wood.density', 'SLA',
'Leaf.N', 'Max.height'), <