A pure R implementation of single linkage hierarchical clustering to help understand the method