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...