Unable to get output for givsGeoChart in my shiny Dashboard.
Below is the code for the same.
library(shiny)
library(shinydashboard)
library(googleVis)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
htmlOutput("Accidents")
)
)
server <- function(input, output) {
output$Accidents <- renderGvis({
gvisGeoChart(Dum, "States","Road_Accident",
options=list(region="IN",displayMode="regions",resolution="provinces",width="100%"))
})
}
shinyApp(ui, server)
The above code doesn't work.
GeoStates_IN <- gvisGeoChart(Dum, "States","Road_Accident",options=list(region="IN",displayMode="regions",resolution="provinces",width="100%"))
plot(GeoStates_IN)
whereas this code works.Unable to figure out what is missing in above code.
Any kind of help is appreciated.
Problem has something to do with your
options()
or data. Is your variable dum cotaining columns "States" and "Road_Accident". Have you included the data inserver.R
?This works: