if (interactive()) {
library(shiny)
library(shinyscreenshot)
shinyApp(
ui = fluidPage(
h1("{shinyscreenshot} demo"),
screenshotButton(label = "Capture entire page"),
screenshotButton(label = "Capture plot", id = "plot"), br(), br(),
numericInput("num", "Number of points", 50),
plotOutput("plot")
),
server = function(input, output) {
output$plot <- renderPlot({
plot(runif(input$num))
})
}
)
}
Run the code above in your browser using DataLab