如何解决无法加载HTTP资源,地理编码
运行以下代码时,出现以下错误
无法加载HTTP资源 错误:1:无法加载HTTP资源
.geocode中的错误(xx $ place,oneRecord = oneRecord,范围=范围,进度=进度): 找不到对象“ doc”
search.string<-"#USAElections2020"
no.of.tweets<-2000
Jtweets<-searchTwitter(search.string,n=no.of.tweets,lang="en")
df<-do.call("rbind",lapply(Jtweets,as.data.frame))
View(df)
userInfo<-lookupUsers(df$screenName)
#Batch lookup of user info
userFrame<-twListToDF(userInfo)
#Convert to a nice dF
locatedUsers<-!is.na(userFrame$location)
#Keep only users with location info
head(userFrame)
head(locatedUsers)
install.packages("dismo")
install.packages("maps")
library(dismo)
library(maps)
locations=geocode(userFrame$location[locatedUsers])
#Use amazing API to guess
head(locations)
#approximate lat/lon from textual location data.
with(locations,plot(longitude,latitude))
write.csv(locations,"JeruLocation.csv")
table(locations$interpretedPlace)
head(locations$interpretedPlace```
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。