Hello!
I am looking at the following code, which I found online:
module_ui <- function(id) {
ns <- NS(id)
tagList(
actionButton(ns("btn"), "Click me", style = "float: right;"),
textOutput(ns("txt"))
)
}
module_server <- function(id) {
moduleServer(id, function(input, output, session) {
txt <- eventReactive(input$btn, input$btn)
output$txt <- renderPrint(txt()[[1]])
})
}
#Next the shiny app
library(shiny)
ui <- {
fluidPage(
module_ui("mod")
)
}
server <- function(input, output, session) {
module_server("mod")
}
shinyApp(ui, server)
I run this with display.mode="showcase". I actually have 2 questions, please:
a. Is there a way to always display the code on the right hand side of the app, please?
b. Is there a way to copy the code to the clipboard, maybe using the rclipboard package, please?
Thanks so much,
Sincerely,
Erin