经纬度坐标数据处理——基于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)

 

posted @ 2016-04-23 18:31  小星星☆  阅读(1951)  评论(0编辑  收藏  举报