I am working on a shiny app which contains a list of dataframes (table_list
) and below is a reactive function assignment from that app. There is an input value input$column_names
which is a list of column names that correspond to the column names in table_list
. I want to reactively select these columns within a lapply()
function using the column names. Below is my failed attempt.
Selected_column <- reactive({
req(table_list())
lapply(table_list, function(DT){
DT$input$column_name
})
})
The line DT$input$column_name
returns a NULL value. So my question is, how can I select a column of a given list dataframe based on a column name input?