get_node_names: Get node names

Description Usage Arguments Value Note Examples

View source: R/generics.R

Description

Get node names

Usage

1

Arguments

x

Either a 'network', 'network_module', or 'matrix' object.

...

Additional arguments.

Value

A vector containing the node names or node indices.

Note

Modules do not retain the names of each node, so the node indicies are returned instead. These can be used to index into the vector of node names obtained from the network.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Create a random network with 10 nodes. 
nw <- random_network(10)
get_node_names(nw) # Default names are 1, 2, ..., 10.
nw <- set_node_names(nw, paste("node", 1:10, sep = "_"))
get_node_names(nw) # Print out updated node names.
# Modules only contain the indicies to nodes, not the node names
module <- nw$modules[[1]]
get_node_names(module)
# When converting the network to a matrix, node names appear as column names.
adj_matrix <- get_adjacency_matrix(nw)
colnames(adj_matrix) 

SeqNet documentation built on July 9, 2021, 9:08 a.m.