tests/testthat/demo_r_file_runapp.R

# Apps can be run without a server.r and ui.r file
runApp(list(
  ui = fluidPage(
    numericInput("n", "n", 20),
    plotOutput("plot")
  ),
  server = function(input, output) {
    data <- reactive(head(cars, input$n))
    output$plot <- renderPlot(plot(data()))
  }
))

dummy_input <- list(n = 20)
rjake/shinysim documentation built on Nov. 11, 2019, 2:29 a.m.