Skip to content
Snippets Groups Projects
Commit f1611e6b authored by Francesco Sabatini's avatar Francesco Sabatini
Browse files

Aligned

parent 18c0251c
Branches Cover
No related tags found
No related merge requests found
......@@ -82,18 +82,17 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
traits <- traits %>%
rename_all(.funs=~gsub(pattern=".mean$", replacement="", x=.)) %>%
mutate_if(~is.character(.), .funs=~as.factor(.)) %>%
filter(complete.cases(.)) %>% ## TEMPORARY ! only species without any NA
column_to_rownames("species0")
#temporary ### Use only a subset of traits
#dplyr::select(LeafArea:Disp.unit.leng)
print("TEMPORARY - delete species with any NA in traits")
traits <- traits %>%
filter(complete.cases(.))
print("TEMPORARY - only species without any NA")
species <- species %>%
dplyr::select(rownames(traits))
dplyr::select(rownames(traits))
print("TEMPORARY - revert back species to pa")
print("TEMPORARY - revert abundances back to pa")
species <- (species>0)*1
#temporary ### Use only a subset of traits
#dplyr::select(LeafArea:Disp.unit.leng)
if(combinations=="all") {
## create list of indices for each combination of traits up to a max number of interactions
......@@ -119,10 +118,10 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
corXY.output <- foreach(i=1:length(allcomb.t), .combine=rbind) %myinfix% {
tt <- unlist(allcomb.t[i])
corXY.output <- rbind(corXY.output,
get.corXY.bootstrap(comm=species, trait=traits,
myfunction(comm=species, trait=traits,
trait.sel=tt, bootstrap=nperm))
}
save(corXY.output, file = paste(output, "_.RData", sep=""))
save(corXY.output, file = paste(output,"_", chunk.i, "_.RData", sep=""))
}
......
......@@ -105,4 +105,4 @@ ncores <- cli$options$ncores
# ------------------------------------------------------------------------------
source("01b_MesobromionCluster.R")
Mesobromion(species.path, traits.path, output, myfunction, combinations, start.round, relax.round, max.inter.t, chunk.n, chunk.i, nperm, ncores)
Mesobromion(species.path, traits.path, output, myfunction, combinations, start.round, relax.round, max.inter.t, chunkn, chunk.i, nperm, ncores)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment