Skip to contents

Extract all node or edge indices from a spatial network

Usage

node_ids(x, focused = TRUE)

edge_ids(x, focused = TRUE)

Arguments

x

An object of class sfnetwork.

focused

Should only the indices of features that are in focus be extracted? Defaults to TRUE. See focus for more information on focused networks.

Value

A vector of integers.

Details

The indices in these objects are always integers that correspond to rownumbers in respectively the nodes or edges table.

Examples

net = as_sfnetwork(roxel[1:10, ])
node_ids(net)
#>  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
edge_ids(net)
#>  [1]  1  2  3  4  5  6  7  8  9 10