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.

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

  • net_layers() returns the number of layers in a multiplex network.

  • layer_ties() returns the number of ties in a vector as long as the number of layers in the network.

  • net_waves() returns the number of waves a panel network records, see is_longitudinal(). A network that is not a panel has one wave.

  • net_times() returns the number of distinct moments a network records, however it records them: the waves of a panel, the events of a dynamic network, or the moments an interval network begins and ends a tie at. See the Time section of to_time().

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

net_nodes(.data)

net_modes(.data)

net_ties(.data)

net_layers(.data)

layer_ties(.data)

net_waves(.data)

net_times(.data)

mode_nodes(.data)

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

Value

net_*() functions always relate to the overall graph or network, usually returning a scalar. mode_nodes() 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. layer_ties() returns an integer of the number of ties in a single-layer network, or one integer per layer (in layer_names() order) in the case of a multiplex 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
layer_ties(fict_marvel)
#> [1] 558 683
net_waves(ison_monks)
#> [1] 3
net_times(irps_wwi)
#> [1] 7
mode_nodes(ison_southern_women)
#> [1] 18 14
mode_nodes(to_mode1(ison_southern_women))
#> [1] 18