mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-30 01:08:43 -05:00
22 lines
431 B
R
22 lines
431 B
R
library(shiny)
|
|
|
|
shinyServer(function(input, output) {
|
|
|
|
datasetInput <- function() {
|
|
switch(input$dataset,
|
|
"rock" = rock,
|
|
"pressure" = pressure,
|
|
"cars" = cars)
|
|
}
|
|
|
|
output$summary <- reactiveText(function() {
|
|
dataset <- datasetInput()
|
|
summary(dataset)
|
|
})
|
|
|
|
output$view <- reactiveTable(function() {
|
|
obs <- as.integer(input$obs)
|
|
head(datasetInput(), n = obs)
|
|
})
|
|
})
|