How to create text input button based on the data set?

37 views
Skip to first unread message

Ethan Ji

unread,
Oct 19, 2016, 1:12:00 PM10/19/16
to Shiny - Web Framework for R
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!

Tareef Kawaf

unread,
Oct 21, 2016, 9:07:01 AM10/21/16
to Shiny - Web Framework for R
I wonder if this article on insertUI might be what you are looking for.
Reply all
Reply to author
Forward
0 new messages