Let

x = real vector of length n

y = real vector of length n

w = real vector of length m, m typically less than n/2 but can be > n

z = real vector of length m

For w[i], i=1,,,m, find the value of x that is closest to w[i]. In the case of ties, select one (optimally at random or just take the first match). Let z[i] = value of y corresponding to the closest x.

If there is a Fortran or C function (builtin or otherwise) that does much of the work, all the better.

Thanks,

Frank

--

Frank E Harrell Jr Prof. of Biostatistics & Statistics

Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences

U. Virginia School of Medicine http://hesweb1.med.virginia.edu/biostat

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html

Send "info", "help", or "[un]subscribe"

(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch

_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

Frank E Harrell Jr Prof. of Biostatistics & Statistics

Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences

U. Virginia School of Medicine http://hesweb1.med.virginia.edu/biostat

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html

Send "info", "help", or "[un]subscribe"

(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch

_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._