So I am building an R Shinny app that runs a simulation study and so every time the user changes one of the inputs I don't want the app to start running the simulations until they hit a submit button. How can I achieve this?
Here is the code I have so far:
The UI file:
#ui.R
# Define UI for random distribution application
shinyUI(fluidPage(
# Application title
titlePanel("ORR Simulator"),
# Sidebar with controls to select the random distribution type
# and number of observations to generate. Note the use of the
# br() element to introduce extra vertical spacing
sidebarLayout(
sidebarPanel(
fileInput('file1', 'Select the XXX.csv file',
accept=c('text/csv','text/comma-separated-values,text/plain','.csv')),
tags$hr(),
fileInput('file2', 'Select the YYY.csv file',
accept=c('text/csv','text/comma-separated-values,text/plain','.csv')),
tags$hr(),
numericInput("S", "Number of simulations to run:", 100),
mainPanel(
plotOutput("plot")
)
)
))
And so I would like for there to be a button that says something like submit and once they push that the actual R programs runs rather than running as soon as they change any input.