Extract a node attribute.

node_get_attr(.net, .node_attr, .node_index = node_seq(.net))

# S3 method for igraph
node_get_attr(.net, .node_attr,
  .node_index = node_seq(.net))

# S3 method for network
node_get_attr(.net, .node_attr,
  .node_index = node_seq(.net))

Arguments

.net

network of class igraph or network.

.node_attr

character scalar corresponding to the name of a node attribute in .net.

.node_index

numeric or logical vector indicating which nodes to target.

Value

vector (typically)

Examples

node_get_attr(.net = florence_business_ig, .node_attr = "wealth")
#> [1] 10 36 55 44 20 32 8 42 103 48 49 3 27 10 146 48
florence_business_nw %>% node_get_attr(.node_attr = "wealth")
#> [1] 10 36 55 44 20 32 8 42 103 48 49 3 27 10 146 48