Skip to content

Commit 700ce19

Browse files
authored
Use non-deprecated obj_*() family (tidyverse#1150)
1 parent e5435f1 commit 700ce19

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

R/list-combine.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#'
3939
#' list_cbind(x2)
4040
list_c <- function(x, ..., ptype = NULL) {
41-
vec_check_list(x)
41+
obj_check_list(x)
4242
check_dots_empty()
4343

4444
# For `list_c()`, we don't expose `list_unchop()`'s `name_spec` arg,
@@ -77,7 +77,7 @@ list_rbind <- function(x, ..., names_to = rlang::zap(), ptype = NULL) {
7777

7878

7979
check_list_of_data_frames <- function(x, error_call = caller_env()) {
80-
vec_check_list(x, call = error_call)
80+
obj_check_list(x, call = error_call)
8181

8282
is_df_or_null <- map_lgl(x, function(x) is.data.frame(x) || is.null(x))
8383

R/list-flatten.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ list_flatten <- function(
4646
name_spec = "{outer}_{inner}",
4747
name_repair = c("minimal", "unique", "check_unique", "universal")
4848
) {
49-
vec_check_list(x)
49+
obj_check_list(x)
5050
check_dots_empty()
5151
check_string(name_spec)
5252

@@ -55,7 +55,7 @@ list_flatten <- function(
5555

5656
# Unclass S3 lists to avoid their coercion methods. Wrap atoms in a
5757
# list of size 1 so the elements can be concatenated in a single list.
58-
proxy <- map_if(proxy, vec_is_list, unclass, .else = list)
58+
proxy <- map_if(proxy, obj_is_list, unclass, .else = list)
5959

6060
out <- list_unchop(
6161
proxy,

R/list-simplify.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#'
99
#' @param x A list.
1010
#' @param strict What should happen if simplification fails? If `TRUE`
11-
#' (the default) it will error. If `FALSE` and `ptype` is not supplied,
11+
#' (the default) it will error. If `FALSE` and `ptype` is not supplied,
1212
#' it will return `x` unchanged.
1313
#' @param ptype An optional prototype to ensure that the output type is always
1414
#' the same.
@@ -66,7 +66,7 @@ simplify_impl <- function(x,
6666
ptype = NULL,
6767
error_arg = caller_arg(x),
6868
error_call = caller_env()) {
69-
vec_check_list(x, arg = error_arg, call = error_call)
69+
obj_check_list(x, arg = error_arg, call = error_call)
7070

7171
# Handle the cases where we definitely can't simplify
7272
if (strict) {

R/modify-tree.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#' a node (by returning `TRUE`) or a leaf (by returning `FALSE`). The
1111
#' default value, `NULL`, treats simple lists as nodes and everything else
1212
#' (including richer objects like data frames and linear models) as leaves,
13-
#' using [vctrs::vec_is_list()]. To recurse into all objects built on lists
13+
#' using [vctrs::obj_is_list()]. To recurse into all objects built on lists
1414
#' use [is.list()].
1515
#' @param pre,post Functions applied to each node. `pre` is applied on the
1616
#' way "down", i.e. before the leaves are transformed with `leaf`, while
@@ -62,7 +62,7 @@ modify_tree <- function(x,
6262

6363
as_is_node <- function(f, error_call = caller_env(), error_arg = caller_arg(f)) {
6464
if (is.null(f)) {
65-
vec_is_list
65+
obj_is_list
6666
} else {
6767
is_node_f <- rlang::as_function(f, call = error_call, arg = error_arg)
6868
as_predicate(

R/modify.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
modify <- function(.x, .f, ...) {
8888
.f <- as_mapper(.f, ...)
8989

90-
if (vec_is_list(.x)) {
90+
if (obj_is_list(.x)) {
9191
out <- map(vec_proxy(.x), .f, ...)
9292
vec_restore(out, .x)
9393
} else if (is.data.frame(.x)) {
@@ -137,7 +137,7 @@ modify_at <- function(.x, .at, .f, ...) {
137137
modify2 <- function(.x, .y, .f, ...) {
138138
.f <- as_mapper(.f, ...)
139139

140-
if (vec_is_list(.x)) {
140+
if (obj_is_list(.x)) {
141141
out <- map2(vec_proxy(.x), .y, .f, ...)
142142
vec_restore(out, .x)
143143
} else if (is.data.frame(.x)) {
@@ -172,7 +172,7 @@ imodify <- function(.x, .f, ...) {
172172
# helpers -----------------------------------------------------------------
173173

174174
modify_where <- function(.x, .where, .f, ..., .purrr_error_call = caller_env()) {
175-
if (vec_is_list(.x)) {
175+
if (obj_is_list(.x)) {
176176
out <- vec_proxy(.x)
177177
out[.where] <- no_zap(map(out[.where], .f, ...), .purrr_error_call)
178178
vec_restore(out, .x)

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ vctrs_list_compat <- function(x,
105105
error_call = caller_env(),
106106
error_arg = caller_arg(x)) {
107107
out <- vctrs_vec_compat(x, user_env)
108-
vec_check_list(out, call = error_call, arg = error_arg)
108+
obj_check_list(out, call = error_call, arg = error_arg)
109109
out
110110
}
111111

man/list_assign.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/map_depth.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/modify_tree.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)