best attempt at nearest neighbor

Close, but not quite finished. Got a neighbor from the test data for each item in the training data, but need to then predict a label. Unsure of accuracy of the other work, as a certain value seemed to crop up more often than made sense.
Because R is vectorized, you don't actually need to subtract the elements separately... you can just do vector1 minus vector2.