Herbivores clustering
🐛 Fixing errors 🚧 Increasing max_vem_steps Herbivores ⏲️ Switch to future
This commit is contained in:
parent
395a7beaed
commit
e9607d18af
2 changed files with 13 additions and 6 deletions
|
|
@ -23,12 +23,15 @@ binary_interaction_data <- interaction_data %>%
|
|||
insectspecies,
|
||||
sep = "_"
|
||||
)
|
||||
) %>% select(-c(insectorder:plantspecies, interquant))
|
||||
) %>%
|
||||
select(-c(insectorder:plantspecies, interquant))
|
||||
|
||||
netlist <- lapply(vec_web, function(web) {
|
||||
web_interaction_data <- binary_interaction_data[which(binary_interaction_data[["web"]] == web), ]
|
||||
incidence_matrix <- table(web_interaction_data[["plantname"]],
|
||||
web_interaction_data[["insectname"]])
|
||||
incidence_matrix <- (table(
|
||||
web_interaction_data[["plantname"]],
|
||||
web_interaction_data[["insectname"]]
|
||||
) != 0L) * 1L
|
||||
})
|
||||
|
||||
names(netlist) <- vec_web
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ library(colSBM)
|
|||
library(dplyr)
|
||||
library(tidyr)
|
||||
library(here)
|
||||
library(future.apply)
|
||||
|
||||
plan(multicore)
|
||||
|
||||
application_name <- "herbivores"
|
||||
|
||||
|
|
@ -55,14 +58,15 @@ list_collection <- clusterize_bipartite_networks(
|
|||
nb_cores = parallelly::availableCores(omit = 1L) %/% 2L,
|
||||
verbosity = 2L,
|
||||
plot_details = 0L,
|
||||
backend = "parallel"
|
||||
)
|
||||
backend = "future"
|
||||
),
|
||||
fit_opts = list(max_vem_steps = 500L)
|
||||
)
|
||||
|
||||
save_file <- file.path(
|
||||
save_folder, paste0(
|
||||
sprintf("%s_collection_", application_name),
|
||||
model, "_", start_time, ".Rds"
|
||||
model, "_", start_time, "maxsteps_500.Rds"
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue