Solved – kNN randomization test in R

k nearest neighbourr

I am trying to determine significant differences between groups of data using a k-nearest neighbor randomization test in R. This test basically looks for similarity amongst homogenous groups and separates them out using random clustering. In the literature, this test is called a "K-nearest neighbor (kNN) randomization test," however, I'm not certain if it called by other names elsewhere.

For my specific data, I have isotopic ratios given for various prey items. I have already grouped together ecologically similar prey item types, and now want to see if those groups differ from one another in their isotopic signature. This is where the kNN test would come in.

Thanks for all of your answers – I'm new to this site, so I'll address your inquiries as applicable in the comments section.

Best Answer

kmeans() (you can find it by typing ?? followed by the name of what you want as in ??kmean). In general, a good trick is to first look it up on a R specific search engine