glmer.all.output.R 900 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env Rscript

source("R/analysis/glmer.output-fun.R")
source("R/analysis/glmer.run.all.R")

## LOOP OVER FILES AND NOT SCAN ALL FILES
traits <- c("SLA", "Wood.density","Max.height","Leaf.N","Seed.mass")
type.filling <- 'species'
files <-  c()
for (trait in traits){
    for(model in c(model.files.lmer.Tf.1, model.files.lmer.Tf.2,
                   model.files.lmer.Tf.3, model.files.lmer.Tf.4)){
       source(model, local = TRUE)
       model.obj <- load.model()
       pathout <- output.dir.glmer(model.obj$name, trait, 'all',
                                type.filling=type.filling)

       files <- c(files,file.path(pathout,"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.list.out.rds')