I am building a widget on Shiny, and I would like to have the option \"all\" to select all of the data available, and don\'t perform a filtering.
Basically, I would
Here is my try. If folt="All" then there is no filter, otherwhise just the Cars with carb==filt is returned.
folt="All"
carb==filt
filt <-sample(c("All", unique(mtcars$carb)),1) filt if(filt=="All"){ data1<- mtcars } else { data1<- filter(mtcars, mtcars$carb==filt) }
should do the trick