Skip to content

Instantly share code, notes, and snippets.

@mages
Last active December 10, 2015 07:18
Show Gist options
  • Save mages/4399886 to your computer and use it in GitHub Desktop.
Save mages/4399886 to your computer and use it in GitHub Desktop.
Test shiny with googleVis
## Diego de Castillo, Markus Gesmann, February 2013
require(shiny)
require(googleVis)
shinyServer(function(input, output) {
myCities <- reactive({
input$Cities
})
output$gvis <- renderGvis({
myData <- head(CityPopularity, myCities())
gvisPieChart(myData)
})
})
require(shiny)
shinyUI(pageWithSidebar(
headerPanel("Example 2: pie chart"),
sidebarPanel(
numericInput("Cities","Number of cities:", 2)
),
mainPanel(
htmlOutput("gvis")
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment