These functions extract certain attributes from network data:

  • node_attribute() returns an attribute's values for the nodes in a network.

  • node_names() returns the names of the nodes in a network.

  • node_is_mode() returns the mode of the nodes in a network.

  • tie_attribute() returns an attribute's values for the ties in a network.

  • tie_weights() returns the weights of the ties in a network.

  • tie_signs() returns the signs of the ties in a network.

These functions are also often used as helpers within other functions. node_*() and tie_*() always return vectors the same length as the number of nodes or ties in the network, respectively.

node_attribute(.data, attribute)

node_names(.data)

node_is_mode(.data)

tie_attribute(.data, attribute)

tie_weights(.data)

tie_signs(.data)

Arguments

.data

An object of a manynet-consistent class:

  • matrix (adjacency or incidence) from {base} R

  • edgelist, a data frame from {base} R or tibble from {tibble}

  • igraph, from the {igraph} package

  • network, from the {network} package

  • tbl_graph, from the {tidygraph} package

attribute

Character string naming an attribute in the object.

Examples

node_attribute(fict_lotr, "Race")
#>  [1] "Human"  "Human"  "Hobbit" "Elf"    "Human"  "Elf"    "Elf"    "Human" 
#>  [9] "Human"  "Hobbit" "Elf"    "Maiar"  "Dwarf"  "Elf"    "Hobbit" "Hobbit"
#> [17] "Hobbit" "Hobbit" "Maiar"  "Human"  "Maiar"  "Elf"    "Ent"    "Human" 
#> [25] "Maiar"  "Human"  "Elf"    "Human"  "Elf"    "Human"  "Elf"    "Elf"   
#> [33] "Hobbit" "Human"  "Maiar"  "Human" 
node_names(ison_southern_women)
#>  [1] "Evelyn"    "Laura"     "Theresa"   "Brenda"    "Charlotte" "Frances"  
#>  [7] "Eleanor"   "Pearl"     "Ruth"      "Verne"     "Myra"      "Katherine"
#> [13] "Sylvia"    "Nora"      "Helen"     "Dorothy"   "Olivia"    "Flora"    
#> [19] "E1"        "E2"        "E3"        "E4"        "E5"        "E6"       
#> [25] "E7"        "E8"        "E9"        "E10"       "E11"       "E12"      
#> [31] "E13"       "E14"      
node_is_mode(ison_southern_women)
#>   Evelyn Laura Theresa Brenda Charlotte Frances Eleanor Pearl Ruth  Verne Myra 
#> 1 FALSE  FALSE FALSE   FALSE  FALSE     FALSE   FALSE   FALSE FALSE FALSE FALSE
#> # ... with 7 more values from this nodeset unprinted. Use `print(..., n = Inf)` to print all values.
#>   E1    E2    E3    E4    E5    E6    E7    E8    E9    E10   E11   E12   E13  
#> 1 TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE 
#> # ... with 1 more values from this nodeset unprinted. Use `print(..., n = Inf)` to print all values.
tie_attribute(ison_algebra, "task_tie")
#> NULL
tie_weights(to_mode1(ison_southern_women))
#>   `Evelyn-Laura` `Evelyn-Brenda` `Evelyn-Theresa` `Evelyn-Charlotte`
#> 1              6               6                7                  3
#> # ... with 135 more values from this nodeset unprinted. Use `print(..., n = Inf)` to print all values.
tie_signs(ison_marvel_relationships)
#>   `Abomination-Beast` `Abomination-Colossus` `Abomination-Cyclops`
#> 1                  -1                     -1                    -1
#> # ... with 555 more values from this nodeset unprinted. Use `print(..., n = Inf)` to print all values.