Learn R Programming

sfnetworks (version 0.3.1)

spatial_edge_measures: Querying spatial edge measures

Description

These functions are a collection of specific spatial edge measures, that form a spatial extension to edge measures in tidygraph.

Usage

edge_circuity()

edge_length()

edge_straight_length()

Arguments

Value

A numeric vector of the same length as the number of edges in the graph.

Functions

  • edge_circuity: The ratio of the length of an edge linestring geometry versus the straight-line distance between its boundary nodes, as described in Giacomin & Levinson, 2015.

  • edge_length: The length of an edge linestring geometry as calculated by st_length.

  • edge_straight_length: The straight-line distance between the two boundary nodes of an edge, as calculated by st_distance.

Details

Just as with all tidygraph algorithms, spatial edge measures are meant to be called inside tidygraph verbs such as mutate(), where the graph that is currently being worked on is known and thus not needed as an argument to the function. If you want to use an algorithm outside of the tidygraph framework you can use with_graph to set the graph context temporarily while the algorithm is being evaluated.