net <- data.frame(
Site = c(rep("A", 2), rep("B", 3), rep("C", 2)),
Species = c("a", "b", "a", "c", "d", "b", "d"),
Weight = c(10, 100, 1, 20, 50, 10, 20)
)
clusters <- netclu_louvain(net, lang = "igraph", bipartite = TRUE)
clusters_sites <- subset_node(clusters, node_type = "sites")
Run the code above in your browser using DataLab