tidyselect 1.2.0
New features
-
New
tidyselect_data_proxy()
andtidyselect_data_has_predicates()
allows tidyselect to work with custom input types (#242). -
New
eval_relocate()
for moving a selection. This powersdplyr::relocate()
(#232).
Lifecycle changes
-
Using
all_of()
outside of a tidyselect context is now deprecated (#269).
In the future it will error to be consistent withany_of()
. -
Use of
.data
in tidyselect expressions is now deprecated to more cleanly
separate tidy-select from data-masking. Replace.data$x
with"x"
and
.data[[var]]
withany_of(var)
orall_of(var)
(#169). -
Use of bare predicates (not wrapped in
where()
) and indirection (without
usingall_of()
) have been formally deprecated (#317).
Minor improvements and bug fixes
-
Selection language:
-
any_of()
generates a more informative error if you supply too many
arguments (#241). -
all_of()
(likeany_of()
) returns an integer vector to make it easier
to combine in functions (#270, #294). It also fails when it can't find
variables even whenstrict = FALSE
. -
matches()
recognises and correctly uses stringr pattern objects
(stringr::regex()
,stringr::fixed()
, etc) (#238). It also now
works with named vectors (#250). -
num_range()
gains asuffix
argument (#229). -
where()
is now exported, like all other select helpers (#201),
and gives more informative errors (#236).
-
-
eval_select()
withinclude
now preserves the order of the variables
if they're present in the selection (#224). -
eval_select()
always returns a named vector, even when renaming is not
permitted (#220). -
eval_select()
andeval_relocate()
gain newallow_empty
argument which
makes it possible to forbid empty selections withallow_empty = FALSE
(#252). -
eval_select(allow_rename = FALSE)
no longer fails with empty
selections (#221, @eutwt) or with predicate functions (#225). It now properly
fails with partial renaming (#305). -
peek_var()
error now generates hyperlink to docs with recent RStudio (#289). -
vars_pull()
generates more informative error messages (#234, #258, #318)
and gainserror_call
anderror_arg
arguments. -
Errors produced by tidyselect should now be more informative. Evaluation
errors are now chained, with the child error call is set to theerror_call
argument ofeval_select()
andeval_rename()
. We've also improved
backtraces of base errors, and done better at propagating the root
error_call
to vctrs input checkers. -
tidyselect_verbosity
is no longer used; deprecation messaging is now
controlled bylifecycle_verbosity
like all other packages (#317).