Description Usage Arguments Details Value Examples See Also
View source: R/nearest_neighbours_on_a_torus.R
plot
method for an object of class c("nnt")
.
1 2 
x 
an object of class 
... 
Further arguments to be passed to

This function is only applicable in 1 or 2 dimensions, that is,
when ncol(x$data)
= 1 or 2. It provides a visual check that the
wrapping of variables is working as intended, in cases where the
number of query points, that is, nrow(x$query)
is small
enough that sets of nearest neighbours do not overlap much.
If ncol(x$data)
= 1 then the index of each observation is plotted
against its value, using a plotting character pch = 1
. A vertical
line is superimposed at each value in x$query
and the x$k$
nearest neighbours of each line are colourcoded.
If ncol(x$data)
= 2 then x$data[, 2]
is plotted against
x$data[, 1]
, using a plotting character pch = 1
. Each point
in x$query
is plotted with a cross and the x$k$
nearest neighbours of each point are colourcoded.
Colours of the lines/crosses and nearest neighbour points can be set sing an
argument col
. If a variable is wrapped then the default plotting
limits are set using the corresponding values in x$ranges
.
Nothing is returned.
See the examples in nnt
.
nnt
for nearest neighbour with some variables
wrapped on a torus.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.