View source: R/transect-functions.R
dist.along.grad | R Documentation |
This function computes Euclidean distance along points aligned to a given gradient (e.g. elevation).
dist.along.grad(coords, var, grad.order, grad.scaled.min, grad.scaled.max)
coords |
a matrix of x and y coordinates in some projected coordinate system |
var |
a vector of the same length as |
grad.order |
vector of integers that define ordering of coordinates along gradient |
grad.scaled.min |
min value of rescaled gradient values |
grad.scaled.max |
max value of rescaled gradient values |
This function is primarily intended for use within plotTransect
.
A data.frame
object:
scaled gradient values
cumulative distance, scaled to the interval of 0.5, nrow(coords) + 0.5
cumulative distance computed along gradient, e.g. transect distance
sorted gradient values
x coordinates, ordered by gradient values
y coordinate, ordered by gradient values
a vector index describing the sort order defined by gradient values
This function is very much a work in progress, ideas welcome.
D.E. Beaudette
plotTransect
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.