mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-02 02:34:57 -05:00
35 lines
930 B
R
35 lines
930 B
R
library(shiny)
|
|
|
|
# Define UI for dataset viewer application
|
|
shinyUI(fluidPage(
|
|
|
|
# Application title
|
|
titlePanel("Reactivity"),
|
|
|
|
# Sidebar with controls to provide a caption, select a dataset,
|
|
# and specify the number of observations to view. Note that
|
|
# changes made to the caption in the textInput control are
|
|
# updated in the output area immediately as you type
|
|
sidebarLayout(
|
|
sidebarPanel(
|
|
textInput("caption", "Caption:", "Data Summary"),
|
|
|
|
selectInput("dataset", "Choose a dataset:",
|
|
choices = c("rock", "pressure", "cars")),
|
|
|
|
numericInput("obs", "Number of observations to view:", 10)
|
|
),
|
|
|
|
|
|
# Show the caption, a summary of the dataset and an HTML
|
|
# table with the requested number of observations
|
|
mainPanel(
|
|
h3(textOutput("caption")),
|
|
|
|
verbatimTextOutput("summary"),
|
|
|
|
tableOutput("view")
|
|
)
|
|
)
|
|
))
|