Hi I have the shiny R codes like below:
library(shiny)
ui <- fluidPage(
inputPanel(
textInput ("target_1", "enter target 1")
)
)
server <- function(input, output) {
my_df <- data.frame(a=letters[1:4],b=LETTERS[1:4])
}
shinyApp(ui = ui, server = server)
If I have 2 columns in the data set, I want to create 2 text input buttons, if I have 3 columns in the data set, I want to create 3 text input buttons. How can I automatically create the text input buttons based on how many columns the data set has? Can anyone help me? Thanks!