I posed this question imprecisely earlier and did not specify that the pairing needs to be one-to-one. A precise version of the question follows:
Given two numeric vectors of possibly unequal length, I'd like to pair each element of the shorter vector with an element of the longer vector in a one-to-one relationship such that the sum of squared differences between the pairs is minimized. Can someone point me to an R function or an algorithm for accomplishing this? Many thanks to David Winsemius and Andy Liaw who replied with solutions to the problem where the pairing does not have to be one-to- one. Tom Thomas S. Dye, Ph.D. T. S. Dye & Colleagues, Archaeologists, Inc. Phone: (808) 529-0866 Fax: (808) 529-0884 http://www.tsdye.com [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.