the question is straight forward. First, I tried an if-else condition within the render plot. Something like
if (input$Next > 0) {
plot(...)
}
else {
Use a conditional panel like so:
library(shiny)
ui =fluidPage(
sidebarPanel(
conditionalPanel(condition="input.Next>0",
plotOutput("test")),
actionButton("Next", "Next")
))
server=shinyServer(function(input, output, session) {
output$test <- renderPlot({
req(input$Next > 0)
pt <- plot(input$Next,2)
print(pt)
})
})
shinyApp(ui=ui,server=server)