View source: R/radius_graphs.R
| create.rknn.graph | R Documentation |
Creates an undirected Euclidean radius graph from a numeric data matrix.
Use type = "fixed" for a fixed-radius graph, where vertices i and j
are adjacent exactly when their Euclidean distance is at most radius. Use
type = "adaptive.radius" for an adaptive-radius graph based on
observation-specific local scale distances.
create.rknn.graph(
X,
type = c("fixed", "adaptive.radius"),
radius = NULL,
k.scale = NULL,
radius.factor = 1,
radius.rule = c("max", "min", "geomean"),
radius.search = c("ann", "all.pairs"),
return.timing = FALSE,
graph.detail = c("full", "minimal"),
prune.method = c("none", "local.geodesic", "global.geodesic.ratio"),
max.path.edge.ratio.deviation.thld = 0.1,
path.edge.ratio.percentile = 0.5,
prune.tau = 1.05,
prune.local.k = NULL,
with.pruned.edge.stats = FALSE,
connect.components = FALSE,
connect.method = c("component.mst", "component.mst.ann", "global.mst"),
bridge.k = NULL,
bridge.k.max = NULL,
bridge.growth = 2
)
X |
Numeric matrix or data frame with observations in rows. |
type |
Character scalar. |
radius |
Positive numeric scalar. Edges are included when
|
k.scale |
Positive integer smaller than |
radius.factor |
Positive numeric scalar multiplying the adaptive radius. |
radius.rule |
Character scalar. |
radius.search |
Character scalar. |
return.timing |
Logical scalar. If |
graph.detail |
Character scalar. |
prune.method |
Character scalar. |
max.path.edge.ratio.deviation.thld |
Numeric scalar in |
path.edge.ratio.percentile |
Numeric scalar in |
prune.tau |
Numeric scalar greater than 1. For local geometric pruning, an edge may be removed when a retained local alternative path is at most this multiplicative factor times the direct edge length. |
prune.local.k |
Integer scalar or |
with.pruned.edge.stats |
Logical scalar. If |
connect.components |
Logical scalar. If |
connect.method |
Character scalar. |
bridge.k |
Integer scalar or |
bridge.k.max |
Integer scalar or |
bridge.growth |
Numeric scalar greater than 1. Multiplicative growth factor for ANN bridge neighborhoods. |
For type = "fixed", a list of class "radius_graph". For
type = "adaptive.radius", a list of class "adaptive_radius_graph".
Both contain adjacency lists, edge weights, edge matrix, and component
diagnostics. The final graph is stored in adj_list/weight_list; raw
and pruned lifecycle graph stages are stored in corresponding
raw_*/pruned_* fields when graph.detail = "full".
X <- matrix(c(0, 1, 3), ncol = 1)
create.rknn.graph(X, type = "fixed", radius = 1.1)$edge_matrix
create.rknn.graph(X, type = "adaptive.radius", k.scale = 1)$edge_matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.