tests/testthat/apps/app-r/app.R

library(shiny)

ui <- fluidPage(
  sliderInput("n", "N", 0, 100, 40),
  verbatimTextOutput("txt", placeholder = TRUE),
)

server <- function(input, output) {
  output$txt <- renderText({
      paste0("The value of n*2 is ", 2 * input$n)
  })
}

shinyApp(ui, server)

Try the shinylive package in your browser

Any scripts or data that you put into this service are public.

shinylive documentation built on April 4, 2025, 5:45 a.m.