nn {cmna} | R Documentation |
Nearest interpolation
Description
Find the nearest neighbor for a set of data points
Usage
nn(p, y, q)
Arguments
p |
matrix of variable values, each row is a data point |
y |
vector of values, each entry corresponds to one row in |
q |
vector of variable values, each entry corresponds to one column of |
Details
nn
finds the n-dimensional nearest neighbor for given datapoint
Value
an interpolated value for q
See Also
Other interp:
bezier
,
bilinear()
,
cubicspline()
,
linterp()
,
polyinterp()
,
pwiselinterp()
Examples
p <- matrix(floor(runif(100, 0, 9)), 20)
y <- floor(runif(20, 0, 9))
q <- matrix(floor(runif(5, 0, 9)), 1)
nn(p, y, q)
[Package cmna version 1.0.5 Index]