I am looking for a function that, when supplied a vector of floats x, an integer n, and float s, would find me an n-subset of x with the sum closest to s. Can anyone point me to a package/function that can do the job - better yet, provide a relevant code sample? (There are a few relevant packages on CRAN, but lack of examples in their docs is a real problem).
Thank you. -- View this message in context: http://n4.nabble.com/How-to-choose-a-number-subset-with-sum-closest-to-x-tp1439939p1439939.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.