View source: R/radius_graphs.R
| create.rknn.graphs | R Documentation |
Creates a sequence of adaptive-radius graphs by varying the k.scale
parameter passed to create.rknn.graph(type = "adaptive.radius"). By
default, ANN-backed construction uses the batched C++ backend while the
direct all-pairs reference path uses the scalar R loop. Set backend = "r"
to force the scalar loop for ANN parity checks.
create.rknn.graphs(
X,
kmin = NULL,
kmax = NULL,
...,
k.values = NULL,
backend = c("auto", "cpp", "r")
)
X |
Numeric matrix or data frame with observations in rows. |
kmin, kmax |
Optional integer scalars defining the inclusive k range.
Required when |
... |
Additional arguments forwarded to |
k.values |
Optional integer vector of k values to evaluate. When
supplied, |
backend |
Character scalar. |
A list of class "rknn_graphs" with components:
A named list of adaptive-radius graph objects, one per k.
A data frame with one row per k containing edge, component, and MST-repair counts.
Present only when forwarded options request graph timing; contains backend-specific construction timing rows.
Attributes include kmin, kmax, k.values, and n_vertices.
create.rknn.graph()
X <- matrix(c(0, 1, 3, 4), ncol = 1)
result <- create.rknn.graphs(
X,
kmin = 1,
kmax = 2,
radius.search = "all.pairs",
graph.detail = "minimal",
prune.method = "none"
)
names(result$graphs)
result$k_statistics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.