node_list: Create a node list

View source: R/node_edge_list.R

node_listR Documentation

Create a node list

Description

A node list is a data frame containing node names and associated node ID numbers (integers). This function creates a node list from an edge list, as shown in the examples.

Usage

node_list(
  edge_list,
  from = "From",
  to = "To",
  node = "Node",
  node_id = "node_id"
)

Arguments

edge_list

the name of the column in .sutmats containing edge lists or a single edge list data frame. (Default is "Edge list".)

from

the name of the edge_list column containing names of source nodes. (Default is "From".)

to

the name of the edge_list column containing names of destination nodes. (Default is "To".)

node

the name of the output column containing node names. (Default is "Node".)

node_id

the name of the output column containing node ID numbers. (Default is "node_id".)

Details

See edge_list for a function to create edge lists.

Value

a node list

Examples

library(matsbyname)
library(tidyr)
sutmats <- UKEnergy2000mats %>% spread(key = matrix.name, value = matrix)
el <- edge_list(sutmats)$`Edge list`[[1]]
node_list(el)

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