View source: R/geom_pathLength.R
| pathLength | R Documentation |
A simple function that adds the distances of individual segments that form the given input path
pathLength(coords)
coords |
An Nx2 or Nx3 matrix-like object containing ordered 2D or 3D coordinates. |
The total length of the path in mesh units
Write unit tests. Easy (document bad cases too)
Cornel M. Pop
# A 2D example:
coords = data.frame(x=c(1,1,10), y=c(10,1,1))
pathLength(coords)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.