Controlling specific input with the isolate() function

There may be situations when the observer or conductor wants to read the value of an expression but avoid dependency. Suppose we want to import some data or perform some calculations, but only after a button has been clicked.

Let's take a look at this example:

library(shiny) # Define UI for application that draws a histogram ui<- fluidPage( # Application title titlePanel("Old Faithful Geyser Data"), # Sidebar with a slider input for number of bins sidebarLayout( sidebarPanel( sliderInput("bins", "Number of bins:", min = 1, max = 50, value = 30) ), # Show a plot of the generated distribution mainPanel( actionButton("goButton","Go!"), plotOutput("distPlot") ) ) ) # Define server logic required ...

Get Web Application Development with R Using Shiny - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.