# 定义UI
ui = fluidPage(
numericInput("n", "n", 1),
plotOutput("plot")
)
# 开发server
server = function(input, output) {
output$plot <- renderPlot( plot(head(cars, input$n)) )
}
# 定义shiny App
app <- shinyApp(ui, server)
# 运行app
runApp(app)