site_species_subset: Extract a subset of sites or species from a...

View source: R/site_species_subset.R

site_species_subsetR Documentation

Extract a subset of sites or species from a bioregion.clusters object

Description

This function extracts a subset of nodes based on their type ("site" or "species") from a bioregion.clusters object, which contains both types of nodes (sites and species).

Usage

site_species_subset(bioregionalization, node_type = "site", clusters = NULL)

Arguments

bioregionalization

An object of class bioregion.clusters.

node_type

A character string indicating the type of nodes to extract. Possible values are "site" or "species". The default is "site".

clusters

Deprecated. Use bioregionalization instead.

Value

An object of class bioregion.clusters containing only the specified node type (sites or species).

Note

Some bioregion.clusters objects may contain both types of nodes (sites and species). This information is available in the ⁠$inputs$node_type⁠ slot.

This function allows you to extract a specific type of node (either sites or species) from any bioregion.clusters object that includes both.

Author(s)

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)
)

clu <- netclu_louvain(net, lang = "igraph", bipartite = TRUE)

clu_sites <- site_species_subset(clu, node_type = "site")


bioregion documentation built on March 29, 2026, 5:07 p.m.