我正在尝试在我的 Shiny 应用程序中创建动态 UI。每次通过按钮添加输入时,我都会增加一个变量(dealNumber)。但是,我需要从这些新输入中获取值。我将 dealNumber 的值添加到每个输入的 ID。但是,我很难提取这些值。
#I use the following code to create a new input
#dealNumber = 1
column(2,selectInput(paste("optionType",dealNumber,sep=""), label = h5(""),choices = option_type, selected = 1)
#I then need to assign the value from the input above to the variable OptionType. If i use input$"OptionType1" or input$OptionType1 it works. But I need to get the number 1 via a variable so that the code is dynamic.
#I have tried the code below without any sucess
assign("OptionType",input$paste("OptionType",dealNumber,sep=""),.GlobalEnv)
我将不胜感激任何帮助。
谢谢