Shinylive with WebR

Run shiny apps alongside webr in the browser

Author

Roy Francis

Published

September 6, 2024

WebR and shinylive can work together on the same page, but they have separate environments.

1 Shinylive

This is a shinylive app chunk

#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 680

shinyApp(
  ui=fluidPage(
    sliderInput("value", label="Value", min=1, max=50, step=1, value=2),
    textOutput("result"),
    verbatimTextOutput("session")
  ),
  server=function(input, output, session) {
    output$result <- renderText(paste0("Squared: ",input$value^2))
    output$session <- renderPrint(capture.output(sessionInfo()))
  }
)

2 WebR

This is a webr chunk