-
Notifications
You must be signed in to change notification settings - Fork 131
/
Copy pathdeprecated.R
87 lines (76 loc) · 1.97 KB
/
deprecated.R
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#' Deprecated functions
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' Use [tibble()] instead of `data_frame()`.
#'
#' @export
#' @keywords internal
#' @name deprecated
data_frame <- function(...) {
deprecate_warn("1.1.0", "data_frame()", "tibble()")
# Unquote-splice to avoid argument matching
tibble(!!!quos(...))
}
#' @description
#' Use [quasiquotation] instead of `tibble_()`, `data_frame_()`, and `lst_()`.
#'
#' @export
#' @keywords internal
#' @rdname deprecated
tibble_ <- function(xs) {
deprecate_soft("2.0.0", "tibble_()", "tibble()",
details = '`tibble()` supports dynamic dots, see `?"dyn-dots"`.'
)
xs <- compat_lazy_dots(xs, caller_env())
tibble(!!!xs)
}
#' @export
#' @rdname deprecated
data_frame_ <- function(xs) {
deprecate_stop("2.0.0", "data_frame_()", "tibble()",
details = '`tibble()` supports dynamic dots, see `?"dyn-dots"`.'
)
}
#' @export
#' @rdname deprecated
lst_ <- function(xs) {
deprecate_stop("2.0.0", "lst_()", "lst()",
details = '`lst()` supports dynamic dots, see `?"dyn-dots"`.'
)
}
#' @description
#' Use [as_tibble()] instead of `as_data_frame()` or `as.tibble()`, but mind the
#' new signature and semantics.
#'
#' @export
#' @rdname deprecated
as_data_frame <- function(x, ...) {
deprecate_warn("2.0.0", "as_data_frame()",
details = "Please use `as_tibble()` (with slightly different semantics) to convert to a tibble, or `as.data.frame()` to convert to a data frame."
)
as_tibble(x, ...)
}
#' @export
#' @rdname deprecated
as.tibble <- function(x, ...) {
deprecate_warn("2.0.0", "as.tibble()", "as_tibble()",
details = "The signature and semantics have changed, see `?as_tibble`."
)
as_tibble(x, ...)
}
#' @description
#' Use [tribble()] instead of `frame_data()`.
#' @export
#' @rdname deprecated
frame_data <- function(...) {
deprecate_stop("2.0.0", "frame_data()", "tribble()")
}
#' Name repair
#'
#' Please review [vctrs::vec_as_names()].
#'
#' @name name-repair
#' @keywords internal
NULL