I am seeing this error:
Error in aggregate.data.frame: no rows to aggregate when I try to aggregate a variable
aggregatevalue <- aggregate(col1
~ col2, df, sum, na.rm = TRUE)
The error is actually true because in the df I do not have values for col1 and col2 either for the selection I am making from the app. Since, this aggregate is a part of shiny app and I would not like my app to run into error/crash rather I would like it to keep running.
How do I handle this error? So that my app does not crash?