Update nearest.R

added return