The arbitrary function is whatever you use to generate vars Data. Spearman is just a type of correlation (based on rank, not distances of data points)...