project_to_segments | R Documentation |
Finds the projection index for a matrix of points x
, when
projected onto a set of segments defined by segment_start
and segment_end
.
project_to_segments(x, segment_start, segment_end)
x |
a matrix of data points. |
segment_start |
a matrix of segment start points. |
segment_end |
a matrix of segment end points. |
A list with components
x_proj |
a matrix of projections of |
segment |
the index of the segment a point is projected on |
progression |
the progression of a projection along its segment |
distance |
the distance from each point in |
x <- matrix(rnorm(50, 0, .5), ncol = 2) segfrom <- matrix(c(0, 1, 0, -1, 1, 0, -1, 0), ncol = 2, byrow = TRUE) segto <- segfrom / 10 fit <- project_to_segments(x, segfrom, segto) str(fit) # examine output
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.