An R package for the large-margin nearest neighbor algorithm