Reputation: 123
How can I handle that when only one filter criteria or no filter criteria are choosen that no exeption occurs?
temp <-
df %>%
filter(
param1 %in% input$input_1,
param2 == input$input_2
)
Upvotes: 0
Views: 68
Reputation: 2573
Apply filtering only when input is not null:
if(is.null(input$input_1)){
temp <- df # i.e., no filtering
}else{
temp <- df %>%
filter(param1 %in% input$input_1)
}
Upvotes: 1