Wednesday, January 17, 2018

Charts using GoogleVis

usePackage <- function(p) {
  if (!is.element(p, installed.packages()[,1]))
    install.packages(p, dep = TRUE)
  require(p, character.only = TRUE)
}

usePackage("googleVis")
require(xlsx)
StateMilk <- read.xlsx(file = "my chart.xlsx", sheetIndex = 1)
View(StateMilk)
StateMilkTotal <- StateMilk[, c("State.UT.s","Total")]
StateName <- StateMilk[, "State.UT.s"]
head(StateName)
head(StateMilkTotal)

GeoStates <- gvisGeoChart(StateMilk, "State.UT.s", "Total", options=list(region="IN", displayMode="markers", resolution="provinces", width=1200, height=800))
plot(GeoStates)
GeoStates2 <- gvisGeoChart(StateMilk, "State.UT.s", "Total", options=list(region="IN", displayMode="regions", resolution="provinces", width=600, height=400))
plot(GeoStates2)
print(GeoStates2)




No comments:

Post a Comment

5 States data in geoChart