View source: R/TreeBasedMethods.R
projectOnTree | R Documentation |
Project the given dataoints onto the tree defined by the vertices (V.pos) and binary adjacency matrix (princAdj)
projectOnTree(data.pnts, V.pos, princAdj)
data.pnts |
(D x N numeric) the spatial coordinates of data points to project |
V.pos |
(D x K numeric) the spatial coordinates of the tree vertices |
princAdj |
(K x K logical) a symmetric binary adjacency matrix (K x K) |
data points are projected on their nearest edge, defined to be the edge that is connected to the nearest node and has minimal length of orthogonal projection. Data points are projected with truncated orthogonal projection: point that fall beyond the edge are projected to the closer node.
(list) projection information:
"spatial"The D-dimensional position of the projected data points
"edge"a Nx2 matrix, were line i has the indices identifying the edge that datapoint i was projected on, represented as (node a, node b). For consistency and convenience, it is maintained that a < b
"edgePos"an N-length numeric with values in [0,1], the relative position on the edge of the datapoint. 0 is node a, 1 is node b, .5 is the exact middle of the edge, etc.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.