1

When I want to create the map using the gvisGeoMap() from googleVis, I get error:

## 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

The above is the error in the "RGui". The error message in "RStudio" is differet:

#object of type 'closure' is not subsettable

and the browser does not fire at all. The HTTP server works fine since I can simply call help pages.( for example ?googleVis will fire up the browser and give the help page). The "Geo" object in the code above is fine and contains the html code only that the plot() does not do what it is supposed to do (I can manually run the html file in the temp folder and see the results). The example above is available here.

I would appreciate your clues.

Thank you

4

1 回答 1

0

这是与包的作者对应的结果。似乎有一个错误阻止了情节正常工作。发布了一个新版本。您可以在下面找到链接。TQ

.....昨天晚上我意识到,在 googleVis 0.3.0 版本中,不幸的是,我在 Windows 上的 RStudio 和 R 中引入了一个错误。该错误已经修复,我们的项目站点(这里是链接)提供了一个新版本(0.3.1),但还没有在 CRAN 上。

我已经在我的博客上写了一个注释(这里是链接)以通知其他人。

我希望这有帮助。

此致

马库斯

于 2012-10-23T06:16:50.637 回答