added kellyo 1NN R function

good use of dist and rbind