diff --git a/01b_MesobromionCluster.R b/01b_MesobromionCluster.R index 79bf5979c87e2dca2166ff1c8016f55378fc4500..223f6cd03f863b5ebfb22df8ab9ba7ad0ce5eb9a 100644 --- a/01b_MesobromionCluster.R +++ b/01b_MesobromionCluster.R @@ -80,11 +80,20 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY traits <- traits %>% - column_to_rownames("species0") %>% rename_all(.funs=~gsub(pattern=".mean$", replacement="", x=.)) %>% - mutate_if(~is.character(.), .funs=~as.factor(.)) + mutate_if(~is.character(.), .funs=~as.factor(.)) %>% + 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(.)) + species <- species %>% + dplyr::select(rownames(traits)) + + print("TEMPORARY - revert back species to pa") + species <- (species>0)*1 if(combinations=="all") { ## create list of indices for each combination of traits up to a max number of interactions