vctrs 0.6.0
-
New
vec_run_sizes()
for computing the size of each run within a vector. It
is identical to thetimes
column fromvec_unrep()
, but is faster if you
don't need the run key (#1210). -
New
sizes
argument tovec_chop()
which allows you to partition a vector
using an integer vector describing the size of each expected slice. It is
particularly useful in combination withvec_run_sizes()
andlist_sizes()
(#1210, #1598). -
New
obj_is_vector()
,obj_check_vector()
, andvec_check_size()
validation
helpers. We believe these are a better approach to vector validation than
vec_assert()
andvec_is()
, which have been marked as questioning because
the semantics of theirptype
arguments are hard to define and can often be
replaced byvec_cast()
or a type predicate function like
rlang::is_logical()
(#1784). -
vec_is_list()
andvec_check_list()
have been renamed toobj_is_list()
andobj_check_list()
, in line with the newobj_is_vector()
helper. The
old functions have been silently deprecated, but an official deprecation
process will start in the next vctrs release (#1803). -
vec_locate_matches()
gains a newrelationship
argument that holistically
handles multiple matches betweenneedles
andhaystack
. In particular,
relationship = "many-to-one"
replacesmultiple = "error"
and
multiple = "warning"
, which have been removed from the documentation and
silently soft-deprecated. Official deprecation for those options will start in
a future release (#1791). -
vec_locate_matches()
has changed its defaultneedles_arg
and
haystack_arg
values from""
to"needles"
and"haystack"
, respectively.
This generally generates more informative error messages (#1792). -
vec_chop()
has gained empty...
betweenx
and the optionalindices
argument. For backwards compatibility, supplyingvec_chop(x, indices)
without namingindices
still silently works, but will be deprecated in a
future release (#1813). -
vec_slice()
has gained anerror_call
argument (#1785). -
The
numeric_version
type from base R is now better supported in equality,
comparison, and order based operations (tidyverse/dplyr#6680). -
R >=3.5.0 is now explicitly required. This is in line with the tidyverse
policy of supporting the 5 most recent versions of
R.