View source: R/dist.per.segment.R
| dist.per.segment | R Documentation |
For each segment of a stream, it calculates the distance between each pair of consecutive points and the total distance of that segment (in meters)
dist.per.segment(
network,
nodes,
lon.name = "lon",
lat.name = "lat",
node.name = "id"
)
network |
(data.frame) A data frame with the the following columns (in this order): "lon", "lat", "id" (the output of |
nodes |
(data.frame) A data frame of coordinates for the nodes where stream segments meet. Coordinates should be in the same projected system as the input to |
lon.name |
(character) Name of the column of longitudes (in quotes). Default = "lon" |
lat.name |
(character) Name of the column of latitudes (in quotes). Default = "lat" |
node.name |
(character) Name of the column of segment identities (in quotes). Default = "id" |
A list containing two objects:
segments = the first object: a data frame with the id of each segment, nodes at either end of the segment, and the total distance (in meters) of that segment.
all.distances = the second object: a list, with one data frame per segment containing the distances between each consecutive pair of points along the line.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.