mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-01 02:05:51 -05:00
26 lines
619 B
R
26 lines
619 B
R
library(shiny)
|
|
|
|
# Define UI for dataset viewer application
|
|
shinyUI(pageWithSidebar(
|
|
|
|
# Application title
|
|
headerPanel("Shiny Text"),
|
|
|
|
# Sidebar with controls to select a dataset and specify the number
|
|
# of observations to view
|
|
sidebarPanel(
|
|
selectInput("dataset", "Choose a dataset:",
|
|
choices = c("rock", "pressure", "cars")),
|
|
|
|
numericInput("obs", "Number of observations to view:", 10)
|
|
),
|
|
|
|
# Show a summary of the dataset and an HTML table with the requested
|
|
# number of observations
|
|
mainPanel(
|
|
verbatimTextOutput("summary"),
|
|
|
|
tableOutput("view")
|
|
)
|
|
))
|