plot method for an objects of class
an object of class
Further arguments to be passed to
This function is only applicable in 1 or 2 dimensions, that is,
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.
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
nearest neighbours of each line are colour-coded.
ncol(x$data) = 2 then
x$data[, 2] is plotted against
x$data[, 1], using a plotting character
pch = 1. Each point
x$query is plotted with a cross and the
nearest neighbours of each point are colour-coded.
Colours of the lines/crosses and nearest neighbour points can be set sing an
col. If a variable is wrapped then the default plotting
limits are set using the corresponding values in
Nothing is returned.
See the examples in
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.