File: proxy.R

package info (click to toggle)
r-cran-tidyselect 1.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 616 kB
  • sloc: sh: 13; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 817 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#' tidyselect methods for custom types
#'
#' @description
#' * `tidyselect_data_proxy()` returns a data frame.
#' * `tidyselect_data_has_predicates()` returns `TRUE` or `FALSE`
#'
#' If your doesn't support predicate functions, return a 0-row data frame
#' from `tidyselect_data_proxy()` and `FALSE` from
#' `tidyselect_data_has_predicates()`.
#'
#' @param x A data-frame like object passed to [eval_select()],
#'   [eval_rename()], and friends.
#' @export
tidyselect_data_proxy <- function(x) {
  UseMethod("tidyselect_data_proxy")
}
#' @export
tidyselect_data_proxy.default <- function(x) {
  x
}


#' @rdname tidyselect_data_proxy
#' @export
tidyselect_data_has_predicates <- function(x) {
  UseMethod("tidyselect_data_has_predicates")
}
#' @export
tidyselect_data_has_predicates.default <- function(x) {
  TRUE
}