Description Usage Arguments Details Value Author(s) Examples
This function lets you use googleVis charts as Shiny output. Use it to wrap a
googleVis-generating function that you assign to an output
element in
server.R
; then create an htmlOutput
with the same name in
ui.R
.
1 | renderGvis(expr, env=parent.frame(), quoted=FALSE)
|
expr |
An expression that returns a gvis object. |
env |
The environment in which to evaluate |
quoted |
Is |
More information about shiny is available online: http://www.rstudio.com/shiny/.
You find further examples with googleVis on shiny on mages' blog: http://lamages.blogspot.co.uk/search/label/shiny
Returns a function that can be assigned to a Shiny output
element.
Joe Cheng joe@rstudio.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ## Not run:
# To run this example:
shiny::runApp(system.file("shiny/", package="googleVis"))
# server.R
library(googleVis)
shinyServer(function(input, output) {
datasetInput <- reactive({
switch(input$dataset,
"rock" = rock,
"pressure" = pressure,
"cars" = cars)
})
output$view <- renderGvis({
gvisScatterChart(datasetInput())
})
})
# ui.R
shinyUI(pageWithSidebar(
headerPanel("googleVis on Shiny"),
sidebarPanel(
selectInput("dataset", "Choose a dataset:",
choices = c("rock", "pressure", "cars"))
),
mainPanel(
htmlOutput("view")
)
))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.