mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-02 02:34:57 -05:00
27 lines
661 B
R
27 lines
661 B
R
library(shiny)
|
|
|
|
# Define UI for miles per gallon application
|
|
shinyUI(pageWithSidebar(
|
|
|
|
# Application title
|
|
headerPanel("Miles Per Gallon"),
|
|
|
|
# Sidebar with controls to select the variable to plot against mpg
|
|
# and to specify whether outliers should be included
|
|
sidebarPanel(
|
|
selectInput("variable", "Variable:",
|
|
c("Cylinders" = "cyl",
|
|
"Transmission" = "am",
|
|
"Gears" = "gear")),
|
|
|
|
checkboxInput("outliers", "Show outliers", FALSE)
|
|
),
|
|
|
|
# Show the caption and plot of the requested variable against mpg
|
|
mainPanel(
|
|
h3(textOutput("caption")),
|
|
|
|
plotOutput("mpgPlot")
|
|
)
|
|
))
|