Skip to content
Prev 325573 / 398503 Next

find closest value in a vector based on another vector values

Bert,

I guess I could have been a little more authoritative: the code 
unique(a[sapply(b,function(x) which.min(abs(x-a)))]) is exactly what I need. Thanks for the input, your comments helped us make the code better,

Andras
--- On Tue, 6/18/13, Bert Gunter <gunter.berton at gene.com> wrote: