Tip: Validate the input of each argument

Debugging Shiny apps is a little harder than debugging regular R code.

find_vars <- function(data, filter) {
  stopifnot(is.data.frame(data))
  stopifnot(is.function(filter))
  names(data)[vapply(data, filter, logical(1))]
}