Finds the projection index for a matrix of points x
, when
projected onto a curve s
. The curve need not be of the same
length as the number of points. If the points on the curve are not in
order, this order needs to be given as well, in tag
.
1  get.lam(x, s, tag, stretch = 2)

x 
a matrix of data points 
s 
a parametrized curve, represented by a polygon. 
tag 
the order of the point in 
stretch 
A stretch factor for the endpoints of the curve; a maximum of 2. it allows the curve to grow, if required, and helps avoid bunching at the end. 
A structure is returned which represents a fitted curve. It has components
s 
The fitted points on the curve corresponding to each point

tag 
the order of the fitted points 
lambda 
The projection index for each point 
dist 
The total squared distance from the curve 
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.