R Programming Homework Help on K-Nearest Neighbors