1
当我想创建一个使用从googleVis的gvisGeoMap()地图,我得到错误:GoogleVis,地理分布图绘制错误
## Using the google visualization API with R
library(googleVis)
input<- read.csv("data.csv")
select<- input[which(input$Subgroup=="Total 5-14"),]
select<- input[which(input$Subgroup=="Total 5-14 yr"),]
Map<- data.frame(select$Country.or.Area, select$Value)
names(Map)<- c("Country", "Percentage")
Geo=gvisGeoMap(Map, locationvar="Country", numvar="Percentage",
options=list(height=350, dataMode='regions'))
plot(Geo)
#starting httpd help server ... done
#Error in ifelse(interactive(), getOption("browser"), "false") :
#replacement has length zero
以上是在“RGUI”的错误。 “RStudio”中的错误消息是不同的:
#object of type 'closure' is not subsettable
并且浏览器根本不会触发。 HTTP服务器工作正常,因为我可以简单地调用帮助页面(例如?googleVis将启动浏览器并提供帮助页面)。上面的代码中的“Geo”对象很好,只包含html代码,而plot()并不做它应该做的事情(我可以手动运行临时文件夹中的html文件并查看结果)。上面的例子可用here。
我很感激你的线索。
谢谢
由于文件'data.csv'是您的计算机上而已,我们是不是能够重现错误。 –
非常感谢你,我忘了附上文件。但是,在小插曲(googleVis)pdf中运行示例时,我遇到了同样的错误。如果有人有时间运行上面的代码,data.csv就在这里:https://sites.google.com/site/geosciej/Home/data.csv?attredirects=0&d=1 –