add_edge_ids: Add edge ID numbers to an edge list

View source: R/node_edge_list.R

add_edge_idsR Documentation

Add edge ID numbers to an edge list

Description

The edges in an edge list can have ID numbers. This functions adds a column of edge ID numbers.

Usage

add_edge_ids(edge_list, edge_id = "edge_id")

Arguments

edge_list

the edge list to which edge ID numbers are to be added

edge_id

the name of the edge ID column in the outgoing edge list. (Default is "edge_id".)

Value

edge_list with an added column containing the edge ID numbers.

Examples

library(tidyr)
library(matsbyname)
sutmats <- UKEnergy2000mats %>% spread(key = matrix.name, value = matrix)
# Suppress adding edge IDs
elDF <- edge_list(sutmats, edge_id = NULL)$`Edge list`[[1]]
add_node_ids(elDF)

MatthewHeun/Recca documentation built on Feb. 9, 2024, 6:18 p.m.