These functions extract the values that a network reserves for its ties:

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

  • tie_lengths() returns the lengths of the ties in a network.

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

Each returns a vector the same length as the number of ties in the network, and 1 for every tie where the network records no such value.

tie_weights(.data)

tie_lengths(.data)

tie_signs(.data)

Arguments

.data

An object of a {manynet}-consistent class:

  • adjacency or incidence matrix from {base} R

  • edgelist data.frame from {base} R or tbl/tbl_df from {tibble}

  • stocnet stocnet, from the {manynet} package

  • igraph igraph, from the {igraph} package

  • network network, from the {network} package

  • tidygraph tbl_graph, from the {tidygraph} package

Details

A weight, a length, and a sign each say something different about a tie, and a tie can have all three. A road can be 12 kilometres long (its length), carry 3,000 vehicles a day (its weight), and be a road that its users like or dislike (its sign).

  • A weight is a strength: a larger weight is a stronger tie. It is held as 'weight', and is_weighted() reports whether a network has one. Measures of strength and degree, and of how much a tie can carry, such as maximum flow, read it.

  • A length is a distance: a larger length is a tie that is further to cross. It is held as 'length'. read_geojson() measures one along each line it reads. Measures of shortest paths, such as closeness and betweenness in {netrics}, read it, and so does a spatial layout in {autograph}.

  • A sign is a valence: whether a tie is positive or negative. A 'stocnet' holds it as the sign of the weight, and other classes as 'sign' (see is_signed()).

A network that records only lengths is not weighted, and a network that records only weights has no lengths. A measure that needs one where the network gives only the other makes its own choice of how to read it, and documents that choice. To read the lengths as weights, or the reverse, use for example to_weighted(.data, "length").

See also

measure_attributes_ties for the other attributes of ties.

Other measures: measure_attributes_nodes, measure_attributes_ties, measure_dims

Examples

tie_weights(to_mode1(ison_southern_women))
#>   `Evelyn-Laura` `Evelyn-Brenda` `Evelyn-Theresa` `Evelyn-Charlotte`
#> 1              6               6                7                  3
#> # ... and 135 more values from this nodeset. Use `print_all(...)` to print all values.
tie_lengths(mutate_ties(create_ring(4), length = c(1, 2.5, 1, 2.5)))
#>   `1-2` `2-3` `3-4` `1-4`
#> 1     1   2.5     1   2.5
tie_signs(to_uniplex(fict_marvel,"relationship"))
#>   `Abomination-Abomination` `Abomination-Beast` `Abomination-Colossus`
#> 1                        -1                  -1                     -1
#> # ... and 555 more values from this nodeset. Use `print_all(...)` to print all values.