Applying and Understanding K-Nearest Neighbors (KNN) in R