These functions extract certain attributes from given network data:

  • net_nodes() returns the total number of nodes (of any mode) in a network.

  • net_ties() returns the number of ties in a network.

  • net_dims() returns the dimensions of a network in a vector as long as the number of modes in the network.

These functions are also often used as helpers within other functions.

net_nodes(.data)

net_modes(.data)

net_ties(.data)

net_layers(.data)

net_dims(.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

Value

net_*() functions always relate to the overall graph or network, usually returning a scalar. net_dims() returns an integer of the number of nodes in a one-mode network, or two integers representing the number of nodes in each nodeset in the case of a two-mode network.

Examples

net_nodes(ison_southern_women)
#> [1] 32
net_modes(ison_southern_women)
#> [1] 2
net_ties(ison_southern_women)
#> [1] 89
net_layers(ison_southern_women)
#> [1] 1
net_dims(ison_southern_women)
#> [1] 18 14
net_dims(to_mode1(ison_southern_women))
#> [1] 18