closest: Find closest point(s) in a design or object.
Description
Find closest point(s) in a design matrix or object.
Usage
closest(X, XNew, ...)
Arguments
X
A matrix containing design points as rows or a
"Grid" object.
XNew
A vector or matrix containing one or several 'new'
design points.
...
Other arguments for methods.
Value
A list with elements
index
Integer vector with length equal to the number of 'new' points. Contains
the index of the closest point in X.
value
Matrix with one row for each 'new' design point containing the
closest point as found in X.
dist
Numeric vector with length equal to the number of 'new' points. Contains
the minimal distances.
Details
When X has class "Grid" weighting the factors
has no impact on the (or a) closest point since for each factor
there is normally one (and possibly two) level value(s) which
minimises the distance to the corresponding value in the given new
point (row) of XNew.