from Interactive reports in R with knitr and RStudio
library(googleVis)
op <- options(gvis.plot.tag = "chart") # not enough!
geo <- gvisGeoChart(CityPopularity, locationvar = "City", colorvar = "Popularity",
options = list(region = "US", height = 350, displayMode = "markers", colorAxis = "{colors:\n['orange','blue']}"))
print(geo, "chart")
## Add the mean
CityPopularity$Mean=mean(CityPopularity$Popularity)
CC <- gvisComboChart(CityPopularity, xvar='City',
yvar=c('Mean', 'Popularity'),
options=list(seriesType='bars',
width=450, height=300,
title='City Popularity',
series='{0: {type:\"line\"}}'))
plot(CC)