Hello there!
How can I implement write_clip
or read_clip
, from the pakage clipr
in shinyapps.io? In my computer works perfect, but he server of shiny crashes when these functions are executed.
Here is a minimal example:
Sys.setenv(CLIPR_ALLOW = T)
library(shiny)
library(clipr)ui <- fluidPage(
sliderInput("obs", "Number of observations", 0, 1000, 500),
actionButton("goButton", "Go!", class = "btn-success"),
plotOutput("distPlot")
)server <- function(input, output) {
output$distPlot <- renderPlot({
# Take a dependency on input$goButton. This will run once initially,
# because the value changes from NULL to 0.
input$goButtonobserveEvent(input$goButton,{ clipr::write_clip("holaaaaaaaaaa") }) # Use isolate() to avoid dependency on input$obs dist <- isolate(rnorm(input$obs)) hist(dist)
})
}shinyApp(ui, server)
The log of the shiny apps return this:
Warning: Error in : Clipboard on X11 requires 'xclip' (recommended) or 'xsel'; Clipboard on Wayland requires 'wl-copy' and 'wl-paste'.