rng | R Documentation |
the relative neighborhood graph defined by a set of points.
rng(x=NULL, dx=NULL, r = 1, method = NULL, usedeldir = TRUE, open = TRUE, k = NA, algorithm = 'cover_tree')
x |
a data matrix. Either |
dx |
an interpoint distance matrix. |
r |
a multiplier to grow the balls. |
method |
the method used for the distance.
See |
usedeldir |
a logical. If true and the data are two dimensional and the deldir package is installed, the Delaunay triangularization is first computed, and this is used to compute the relative neighborhood graph. |
open |
logical. If TRUE, open balls are used in the definition. |
k |
If given, |
algorithm |
See |
the relative neighborhood graph is defined in terms of balls
centered at observations. For two observations, the balls are
set to have radius equal to the distance between the observations
(or r
times this distance if r
is not 1). There is
an edge between the vertices associated with the observations if
and only if there are no vertices in the lune defined by the
intersection of the balls.
The flag open
should make no difference for most applications,
but there are very specific cases (see the example section below)
where setting it to be TRUE will give the wrong answer (thanks to
Luke Mathieson for pointing this out to me).
an object of class igraph, with the additional attributes
layout |
the x matrix. |
r,p |
arguments given to |
David J. Marchette david.marchette@navy.mil
J.W. Jaromczyk and G.T. Toussaint, "Relative neighborhood graphs and their relatives", Proceedings of the IEEE, 80, 1502-1517, 1992.
G.T. Toussaint, "A Graph-Theoretic Primal Sketch", Computational Morphology, 229-260, 1988.
D.J. Marchette, Random Graphs for Statistical Pattern Recognition, John Wiley & Sons, 2004.
gg
,cccd
,ccd
,
dist
get.knn
x <- matrix(runif(100),ncol=2) g <- rng(x) ## Not run: plot(g) ## End(Not run) ## Example using 'open': g <- graph.full(5,directed=FALSE) g1 <- rng(x=get.adjacency(g,sparse=FALSE),open=TRUE) ecount(g1) g2 <- rng(x=get.adjacency(g,sparse=FALSE),open=FALSE) graph.isomorphic(g2,g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.