经纬度坐标数据处理——基于R

ggmap

w=read.csv("LA.Neighborhoods.csv")
w=data.frame(w,density=w$Population/w$Area)
u=w[,c(1,2,5,6,11,16)]
hh=hclust(dist(scale(u[,-1])),"complete")
plot(hh,lables=u[,1],cex=.6)
id=identify(hh)

ppp=c(7,17,19,21,24)

plot(w[id[[1]],14:15],pch=ppp[1],col=1,xlim=c(-118.7,-118.1),ylim=c(33.73,34.32),main="Los Angeles")
for(i in 2:5)
points(w[id[[i]],14:15],pch=ppp[i])
legend("bottomleft",pch=ppp,paste("Cluster",1:5))

library(ggmap)
hdf=get_map(location = c(lon = -118.1,lat=33.9))
ggmap(hdf)
原文地址:https://www.cnblogs.com/zzhzhao/p/5425222.html