If subsetting results in multiple disconnected components, we keep the main one.
filter_network(network, target, elements = "nodes")A spatial network object of class sfnetworks::sfnetwork
A spatial network object of class sfnetworks::sfnetwork
The target geometry
The elements of the network to filter. It can be "nodes" or "edges"