| gauge-shiny | R Documentation |
Output and render functions for using gauge within Shiny applications and interactive Rmd documents.
Output and render functions for using gauge within Shiny applications and interactive Rmd documents.
gaugeOutput(outputId, width = "100%", height = "400px") renderGauge(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width, height |
Must be a valid CSS unit (like |
expr |
An expression that generates a gauge |
env |
The environment in which to evaluate |
quoted |
Is |
## Only run this in interactive sessions
if(interactive()){
ui <- fluidPage(
titlePanel("Gauge Example!"),
sidebarLayout(
sidebarPanel(
sliderInput("obs",
"Pick a percentage",
min = 1,
max = 100,
value = 5)
),
mainPanel(
gaugeOutput("gaugePlot")
)
)
)
server <- function(input, output) {
output$gaugePlot <- renderGauge({
gauge(input$obs)
})
}
shinyApp(ui = ui, server = server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.