runNearestNeighborClustering.Rd
A wrapper around the RANN::nn2()
function - nearest neighbor clustering.
runNearestNeighborClustering(
object,
n_pcs = NULL,
k = 50,
naming = "nn2_{priority}_{treetype}",
searchtype = "priority",
treetype = "bd",
radius = 0,
eps = 0,
overwrite = FALSE,
verbose = TRUE
)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Numeric value or NULL
. If numeric, specifies the number of
principal components to use. If NULL
, all principal components are used
(as computed with runPCA()
).
The maximum number of nearest neighbours to compute. The default value is set to the smaller of the number of columnns in data.
Character value. A glue expression for the new cluster variable name.
See details
Character vector. Character vector specifying the standard 'kd' tree or a 'bd' (box-decomposition, AMNSW98) tree which may perform better for larger point sets.
Radius of search for searchtype='radius'
Error bound: default of 0.0 implies exact nearest neighbour search
Logical value. Must be TRUE
to allow overwriting.
Logical. If TRUE
, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
Character value. Either 'priority', 'standard' or 'radius '. See details for more.
The updated input object, containing the added, removed or computed results.
Search types: priority visits cells in increasing order of distance from the query point, and hence, should converge more rapidly on the true nearest neighbour, but standard is usually faster for exact searches. radius only searches for neighbours within a specified radius of the point. If there are no neighbours then nn.idx will contain 0 and nn.dists will contain 1.340781e+154 for that point.
Requires the RANN
packge.