Implementation of k-Nearest Neighbors algorithm from scratch in R. It utilizes some ressources learned from Python, such as fancy indexing and masking to remove for-loops and thus optimize the code without utilizing external libraries.
In this case I use the Iris data set for testing.