Extract node names.

node_get_names(.net)

node_name_attr(.net)

Arguments

.net

network of class igraph or network.

Value

  • node_get_names()

    • character vector

  • node_name_attr():

    • character scalar

Details

  • node_get_names()

    • Uses node_name_attr() to determine node names.

  • node_name_attr()

    • If .net is an igraph object, node_get_names() returns the node (vertex) attribute "name".

      • If "name" is not a node attribute, node_get_names() returns node_seq(.net).

    • If .net is a network object, node_get_names() returns the node (vertex) attribute "vertex.names".

Examples

node_get_names(.net = florence_business_ig)
#> [1] "Acciaiuoli" "Albizzi" "Barbadori" "Bischeri" "Castellani" #> [6] "Ginori" "Guadagni" "Lamberteschi" "Medici" "Pazzi" #> [11] "Peruzzi" "Pucci" "Ridolfi" "Salviati" "Strozzi" #> [16] "Tornabuoni"
florence_business_nw %>% node_get_names()
#> [1] "Acciaiuoli" "Albizzi" "Barbadori" "Bischeri" "Castellani" #> [6] "Ginori" "Guadagni" "Lamberteschi" "Medici" "Pazzi" #> [11] "Peruzzi" "Pucci" "Ridolfi" "Salviati" "Strozzi" #> [16] "Tornabuoni"
node_name_attr(.net = florence_business_ig)
#> [1] "name"
florence_business_nw %>% node_name_attr()
#> [1] "vertex.names"