filter_network: Subset a network keeping the components that intersect a...

View source: R/network.R

filter_networkR Documentation

Subset a network keeping the components that intersect a target geometry.

Description

If subsetting results in multiple disconnected components, we keep the main one.

Usage

filter_network(network, target, elements = "nodes")

Arguments

network

A spatial network object of class sfnetworks::sfnetwork

target

The target geometry

elements

The elements of the network to filter. It can be "nodes" or "edges"

Value

A spatial network object of class sfnetworks::sfnetwork


rcrisp documentation built on Nov. 24, 2025, 5:07 p.m.