Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/knn_hypergraph.R
A hypergraph is constructed from data in which each hyper-edge corresponds to a vertex and its k-nearest neighbors.
1 2 | knn_hypergraph(x, k = 1, method = "Euclidean", reduce=FALSE,
as.graph=FALSE)
|
x |
a matrix of data points. |
k |
the number of neighbors. May be a vector. |
method |
distance type passed to |
reduce |
logical. Whether to remove redundant hyper-edges. |
as.graph |
logical. Whether to return a graph instead of a hypergraph. |
Each vertex is in one-to-one correspondence with the points (rows)
of x
.
For each vertex, the k-closest vertices and itself form a hyper-edge.
If reduce=TRUE
reduntant hyper-edges (those contained in other
hyper-edges) are removed. If as.graph=TRUE
, reduce
is
ignored and the incidence matrix is treated as an adjacency matrix,
returning a (directed) igraph graph.
a hypergraph or graph.
David J. Marchette dmarchette@gmail.com
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.