I am building a shiny web app that takes input values, such as name and gender, from users. I would like to turn those values into a dataframe, but I am getting an "Error: cannot coerce class "c("shiny.render.function", "function")" to a data.frame" error.
Here is what I have in the server.R file:
nText<- eventReactive(input$click_counter, valueExpr = {
a<- renderText(input$name)
b<- renderText(input$gender)
c<- renderText(input$college)
d<- renderText(input$team)
e<- renderText(input$score)
return(data.frame(player=a,college=b,gender=c,team=d,score=e))
})
output$nText<- renderDataTable({
nText()
})
And this is what I have in the ui.R file:
actionButton("click_counter","Submit"),
dataTableOutput("nText")
inputs
withrenderText()
- Yang