as_sfnetwork: Convert Walk Network to sfnetworks Graph

View source: R/interop.R

as_sfnetworkR Documentation

Convert Walk Network to sfnetworks Graph

Description

Converts a walk_network object into an sfnetwork from the sfnetworks package for seamless integration with spatial graph routing and tidygraph analysis workflows.

Usage

as_sfnetwork(x, ...)

## S3 method for class 'walk_network'
as_sfnetwork(x, directed = FALSE, ...)

Arguments

x

A walk_network object.

...

Additional arguments passed to methods.

directed

Logical. If TRUE, creates a directed graph. Default is FALSE (undirected pedestrian network).

Value

An sfnetwork object if sfnetworks is installed.

Examples

data(streets_cusco)
net <- walk_build_network(streets_cusco, verbose = FALSE)
if (requireNamespace("sfnetworks", quietly = TRUE)) {
  sfn <- as_sfnetwork(net)
  print(sfn)
}

walkability documentation built on Nov. 17, 2026, 5:09 p.m.