create_PU_spp_pair_names: Create PU spp pair indices

create_PU_spp_pair_namesR Documentation

Create PU spp pair indices

Description

Create planning unit / species pair indices.

Usage

create_PU_spp_pair_names(PU_spp_pair_indices, PU_col_name, spp_col_name)

Arguments

PU_spp_pair_indices

data frame

PU_col_name

character string

spp_col_name

character string

Details

Though the two data frames carry identical information, it looks like both of them are necessary because different network packages expect different inputs. The bipartite package creates an adjacency matrix based on the indices, but the igraph package creates a bipartite graph using either the indices or the vertex names.

However, if I later decide to use the vertex indices, I need to go back and renumber either the spp vertices or the PU vertices so that they don't overlap the other set. That may end up being the better strategy when graphs get big, but at the moment, giving them names seems less likely to introduce some kind of indexing bug.

Will create names for PU vertices by prepending the vertex ID with a "p". Similarly, spp vertices will be named by prepending with an "s".

NOTE: We have to either uniquely name the vertices or we have to renumber either the spp or the PUs. This is because the numbering of both sets of vertices starts at 1 and that means the vertex IDs are not unique when the two sets are combined.

Value

PU_spp_pair_names_triple plist


langfob/bdpg documentation built on Dec. 8, 2022, 5:33 a.m.