powered by
Find the nearest neighbor for a set of data points
nn(p, y, q)
matrix of variable values, each row is a data point
vector of values, each entry corresponds to one row in p
p
vector of variable values, each entry corresponds to one column of p
an interpolated value for q
nn finds the n-dimensional nearest neighbor for given datapoint
nn
Other interp: bezier, bilinear(), cubicspline(), linterp(), polyinterp(), pwiselinterp()
bezier
bilinear()
cubicspline()
linterp()
polyinterp()
pwiselinterp()
# NOT RUN { 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) # }
Run the code above in your browser using DataLab