I want to create an R-brilliant application with dynamic input, which asks the user for numerical input, and then based on this input generates 4 more input fields. Here is what I mean.
library(shiny)
shinyUI(fluidPage(
titlePanel("Calcs"),
sidebarLayout(
sidebarPanel(
numericInput("dorr", "How many inputs do you want",4),
i = i+1
while(input$dorr<i){
numericInput("S", "Number of simulations to run:", 10)
i=i+1
}
numericInput("S", "Number of simulations to run:", 10),
actionButton(inputId = "submit_loc",label = "Run the Simulation")
),
mainPanel(
)
)))
I know that the code above does not work, but this is my rationale. I know that Shiny has conditional statements, but I can’t find one that allows me to create a predetermined number of additional fields. Is it possible?
source
share