Extract a subset of sites or species from a bioregion.clusters object
Source:R/site_species_subset.R
site_species_subset.Rd
This function extracts a subset of nodes according to its type (sites or species) from a bioregion.clusters object containing both types of nodes (sites and species).
Note
The network clustering functions (prefix netclu_
) may return both types of
nodes (sites and species) when applied on bipartite networks
(argument bipartite
). In this case, the type of nodes returned in the
output can be chosen with the argument return_node_type
. This function
allows to retrieve a particular type of nodes (sites or species) from the
output and modify the return_node_type accordingly.
Author
Maxime Lenormand (maxime.lenormand@inrae.fr)
Pierre Denelle (pierre.denelle@gmail.com)
Boris Leroy (leroy.boris@gmail.com)
Examples
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 <- site_species_subset(clusters, node_type = "site")