Yes, I understood that the actual inputs would come from the user. That is the meaning of "In a shiny app the elements of input would come from the widgets and not be coded in the way I show"
Here is an example
library(shiny)
ui <- fluidPage(
fluidRow(
textInput("name1", "Name 1"),
textInput("name2", "Name 2"),
textInput("value1", "Value 1"),
textInput("value2", "Value 2")
),
fluidRow(
tableOutput("Tbl")
)
)
server <- function(input, output) {
output$Tbl <- renderTable({
DF <- data.frame(input$value1, input$value2)
colnames(DF) <- c(input$name1, input$name2)
DF
})
}
shinyApp(ui,server)