| 1 |
#' tidyselect methods for custom types |
| 2 |
#' |
| 3 |
#' @description |
| 4 |
#' * `tidyselect_data_proxy()` returns a data frame. |
| 5 |
#' * `tidyselect_data_has_predicates()` returns `TRUE` or `FALSE` |
| 6 |
#' |
| 7 |
#' If your doesn't support predicate functions, return a 0-row data frame |
| 8 |
#' from `tidyselect_data_proxy()` and `FALSE` from |
| 9 |
#' `tidyselect_data_has_predicates()`. |
| 10 |
#' |
| 11 |
#' @param x A data-frame like object passed to [eval_select()], |
| 12 |
#' [eval_rename()], and friends. |
| 13 |
#' @export |
| 14 |
tidyselect_data_proxy <- function(x) { |
| 15 |
UseMethod("tidyselect_data_proxy") |
| 16 |
} |
| 17 |
#' @export |
| 18 |
tidyselect_data_proxy.default <- function(x) { |
| 19 |
x |
| 20 |
} |
| 21 |
|
| 22 |
|
| 23 |
#' @rdname tidyselect_data_proxy |
| 24 |
#' @export |
| 25 |
tidyselect_data_has_predicates <- function(x) { |
| 26 |
UseMethod("tidyselect_data_has_predicates") |
| 27 |
} |
| 28 |
#' @export |
| 29 |
tidyselect_data_has_predicates.default <- function(x) { |
| 30 |
TRUE |
| 31 |
} |