I am working on an application that has a leaflet map and a DT data table in it. I set up both to have initial data in the map and table, then update if a specific user name in a dropdown or data range is selected.
The map is population fine. However, I get an error message, which shows in bright red, when the application is loading, that suggests there is an issue with the data table data...but then the data does load (I assume after the reactive component is done loading.
I would love to make this annoying red error go away and could you some help
output$customer_table <- renderDT({ customer_data%>%
select(Customer, Associate, Date, Travel)%>%
datatable( extensions = 'Buttons',
options = list(
dom = 'Bfrtip',
pageLength = 35,
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')),
colnames = c('Customer', 'Associate', 'Date', 'Travel'))})
This has the initial unfiltered data, which is 269 rows long as suggested in the error message. I use the following reactive component (Which is pulling dates from a date input and they are coming in right as it does adjust appropriately based on the selector once the table finally draws). The start and end date are described by input$date[1] & Date < input$date[2]
newData <- reactive({
all = unique(map_data$associate)
map_data <- map_data%>%
filter(Date > input$date[1] & Date < input$date[2])%>%
filter(
if (input$associate == "All") {
Associate %in% all
} else {
Associate==input$associate
}
)
})
then this data is passed into the reactive table to output to the application with the following:
output$customer_table <- renderDT({ newData()%>%
select(Customer, Associate, Date, Travel)%>%datatable( extensions = 'Buttons',
options = list(
dom = 'Bfrtip',
pageLength = 35,
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')),
colnames = c('Customer', 'Associate', 'Date', 'Travel'))})
This is the message I get for a couple of seconds when the map is up, but the table has yet to render
I am not upset about the final layout, it looks fine, but this error message during initial loading is hideous and I would like to have it go away. And if there is an underlying flaw in how I am managing the table data causing this, I would love to know how to fix it. Thanks for your help