Learn R Programming

bioregion (version 1.1.1)

subset_node: Extract a subset of node from a bioregion.clusters object

Description

This function extracts a subset of node according to its type (sites or species) from a bioregion.clusters object containing both types of nodes (sites and species).

Usage

subset_node(clusters, node_type = "sites")

Value

An object of class bioregion.clusters with a given node type (sites or species).

Arguments

clusters

an object of class bioregion.clusters.

node_type

a character indicating what types of nodes ("sites" or "species") should be extracted (node_type = "sites" by default).

Author

Maxime Lenormand (maxime.lenormand@inrae.fr), Pierre Denelle (pierre.denelle@gmail.com) and Boris Leroy (leroy.boris@gmail.com)

Examples

Run this code
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