as_tidygraph: Convert Walk Network to tidygraph tbl_graph

View source: R/interop.R

as_tidygraphR Documentation

Convert Walk Network to tidygraph tbl_graph

Description

Converts a walk_network object into a tbl_graph from the tidygraph package.

Usage

as_tidygraph(x, ...)

## S3 method for class 'walk_network'
as_tidygraph(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.

Value

A tbl_graph object if tidygraph is installed.

Examples

data(streets_cusco)
net <- walk_build_network(streets_cusco, verbose = FALSE)
if (requireNamespace("tidygraph", quietly = TRUE)) {
  tg <- as_tidygraph(net)
  print(tg)
}

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