#Functions for spatial analysis #From MacLean et al. Using museum specimens to track morphological shifts through climate change #Contact: Lauren Buckley, lbbuckley@gmail.com #------------------------ #define functions ClassifySites= function(names, lon, lat, DistCut){ new.names=names stat.coords= cbind(lon,lat) for(r in 1:length(lon) ){ dists= spDistsN1(stat.coords, stat.coords[r,], longlat = TRUE) #find distances from focal site in km new.names[which(dists