lmer.nolog.all.output.R 1014 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
#!/usr/bin/env Rscript

source("R/analysis/lmer.output-fun.R")
source("R/analysis/lmer.run.nolog.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()
10
for (trait in traits){
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    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.obj$name, trait, 'all',
                                type.filling=type.filling)

       files <- c(files,file.path(pathout,"results.nolog.all.rds"))
          
      }
    }


out <- lapply(files, summarise.lmer.output.all.list)
names(out) <- lapply(lapply(files,files.details.all),
                     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/list.lmer.out.nolog.all.rds')