summary.rknn_graphs: Summarize an rknn_graphs Object

View source: R/radius_graphs.R

summary.rknn_graphsR Documentation

Summarize an rknn_graphs Object

Description

Provides a compact table of graph characteristics for an "rknn_graphs" object created by create.rknn.graphs() or cpp.create.rknn.graphs(). The table reports final edge counts, component-repair counts, degree summaries, and density/sparsity for each adaptive-radius k.scale value.

Usage

## S3 method for class 'rknn_graphs'
summary(object, ...)

Arguments

object

An object of class "rknn_graphs".

...

Additional arguments passed to or from other methods; currently unused.

Value

Invisibly returns a data frame with one row per graph and columns:

idx

Position of the graph in the returned graph sequence.

k

The adaptive-radius k.scale value.

n_vertices

Number of graph vertices.

n_ccomp

Number of connected components in the final graph.

n_ccomp_before_repair

Number of components before component-MST repair.

edges

Final number of undirected edges.

edges_before_pruning

Number of edges before geometric pruning.

edges_after_pruning

Number of edges after geometric pruning and before optional component repair.

mst_edges_added

Number of component-MST repair edges added.

mean_degree

Average vertex degree in the final graph.

min_degree

Minimum vertex degree.

median_degree

Median vertex degree.

max_degree

Maximum vertex degree.

max_degree_over_median

Ratio of maximum to median degree, or NA when the median degree is zero.

universal_vertices

Number of vertices adjacent to every other vertex.

density

Final graph density.

sparsity

One minus graph density.

See Also

create.rknn.graphs(), cpp.create.rknn.graphs()

Examples

X <- matrix(c(0, 1, 3, 4), ncol = 1)
graphs <- create.rknn.graphs(
  X,
  kmin = 1,
  kmax = 2,
  radius.search = "all.pairs",
  graph.detail = "minimal",
  prune.method = "none"
)
summary(graphs)


dgraphs documentation built on Aug. 21, 2026, 1:08 a.m.