I'm trying to cast an object value as a dataframe column name:
The object input$year
contains 2017, and what I currently have is yeardata$2017
. I need it to be something like yeardata$(input$year)
, so that yeardata$ gets input$year as the . This is because the input$year will change as it's the result of a function, but its value will always be present as a column name in the yeardata data frame.