如何使用clusplot从我的数据框到图形找到城市的经度和纬度?

时间:2017-11-01 22:08:21

标签: r

我想从我的数据框(名为K.regions)中查找城市列表的经度和纬度 最终我试图将它们聚集在一个图表上。我使用了clusplot作为前一个集群图,并且最终需要将信息合并到该图上。

现在,我似乎无法使用ggmap和plotrix获得经度和纬度。 但是,在运行代码时,我收到一条错误消息。任何帮助将不胜感激!谢谢!

 K.regions <- dplyr::select(K8, 13)
library("ggmap", lib.loc="C:/Program Files/R/R-3.4.1/library")
library(plotrix)

 a1 <- as.character(K.regions)
 lonlat <- geocode(unique(a1)) 
 cities <- cbind(a1, lonlat)

```

当我运行代码时,我收到以下错误消息:

Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=c(%22Dalian%22,%20%22Chongqing%22,%20%22Foshan%22,%20%22Beijing%22,%20%22Shanghai%22,%20%22Wuhan%22,%20%22Zhongshan%22,%20%22Yaogou%22,%20%22Ningbo%22,%20%22Sacramento%22,%20%22Orlando%22,%20%22Jackson%22,%20%22xiaogan%22,%20%22Ningbo%22,%20%22Dalian%22,%20%22Chicago%22,%20%22Tamarac%22,%20%22Jakarta%22,%20%22Lincolnton%22,%20%22Taichung%22,%20%22Hangzhou%22,%20%22Beijing%22,%20%22Beijing%22,%20%22Columbus%22,%20%22Suzhou%22)&sensor=false
geocode failed with status ZERO_RESULTS, location = "c("Dalian", "Chongqing", "Foshan", "Beijing", "Shanghai", "Wuhan", "Zhongshan", "Yaogou", "Ningbo", "Sacramento", "Orlando", "Jackson", "xiaogan", "Ningbo", "Dalian", "Chicago", "Tamarac", "Jakarta", "Lincolnton", "Taichung", "Hangzhou", "Beijing", "Beijing", "Columbus", "Suzhou")"

非常感谢任何和所有帮助。谢谢:))

0 个答案:

没有答案