I have a data table within my shiny app. I would like to hide the first column. Below is part of my code. This part "datatable(population_, options=list(columnDefs = list(list(visible=FALSE, targets=c(1)))))" is assumed to do the job but the column appears in the data table.
Thanks for your help.
Nader
#print data in data tab
bardata_ <- reactive ({
out <- population_ %>%
filter (County %in% input$county,
Year %in% input$years,
Sex %in% input$sex)
return(out)
})
output$data <- DT::renderDataTable ({
datatable(population_, options=list(columnDefs = list(list(visible=FALSE, targets=c(1)))))
(bardata_())
})