Releases: r-lib/vctrs
vctrs 0.6.5
vctrs 0.6.4
-
Fixed a performance issue with
vec_c()
and ALTREP vectors (in particular,
the new ALTREP list vectors in R-devel) (#1884). -
Fixed an issue with complex vector tests related to changes in R-devel
(#1883). -
Added a class to the
vec_locate_matches()
error that is thrown when an
overflow would otherwise occur (#1845). -
Fixed an issue with
vec_rank()
and 0-column data frames (#1863).
vctrs 0.6.3
-
Fixed an issue where certain ALTREP row names were being materialized when
passed tonew_data_frame()
. We've fixed this by removing a safeguard in
new_data_frame()
that performed a compatibility check when bothn
and
row.names
were provided. Because this is a low level function designed for
performance, it is up to the caller to ensure these inputs are compatible
(tidyverse/dplyr#6596). -
Fixed an issue where
vec_set_*()
used with data frames could accidentally
return an object with the type of the proxy rather than the type of the
original inputs (#1837). -
Fixed a rare
vec_locate_matches()
bug that could occur when using a max/min
filter
(tidyverse/dplyr#6835).
vctrs 0.6.2
vctrs 0.6.1
- Fixed a test related to
c.sfc()
changes in sf 1.0-10 (#1817).
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.
vctrs 0.5.2
-
New
vec_expand_grid()
, which is a lower level helper that is similar to
tidyr::expand_grid()
(#1325). -
New
vec_set_intersect()
,vec_set_difference()
,vec_set_union()
, and
vec_set_symmetric_difference()
which compute set operations like
intersect()
,setdiff()
, andunion()
, but the vctrs variants don't strip
attributes and work with data frames (#1755, #1765). -
vec_identify_runs()
is now faster when used with data frames (#1684). -
The maximum load factor of the internal dictionary was reduced from 77% to
50%, which improves performance of functions likevec_match()
,
vec_set_intersect()
, andvec_unique()
in some cases (#1760). -
Fixed a bug with the internal
vec_order_radix()
function related to matrix
columns (#1753).
vctrs 0.5.1
- Fix for CRAN checks.
vctrs 0.5.0
-
vctrs is now compliant with
-Wstrict-prototypes
as requested by CRAN
(#1729). -
vec_ptype2()
now consistently falls back to bare data frame in
case of incompatible data frame subclasses. This is part of a
general move towards relaxed coercion rules. -
Common type and cast errors now inherit from
"vctrs_error_ptype2"
and"vctrs_error_cast"
respectively. They are still both
subclasses from"vctrs_error_incompatible_type"
(which used to be
their most specific class and is now a parent class). -
New
list_all_size()
andlist_check_all_size()
to quickly determine if a
list contains elements of a particularsize
(#1582). -
list_unchop()
has gained empty...
to force optional arguments to be
named (#1715). -
vec_rep_each(times = 0)
now works correctly with logical vectors that are
considered unspecified and with named vectors (#1673). -
list_of()
was relaxed to make it easier to combine. It is now
coercible withlist()
(#1161). When incompatiblelist_of()
types
are combined, the result is now a barelist()
.Following this change, the role of
list_of()
is mainly to carry
type information for potential optimisations, rather than to
guarantee a certain type throughout an analysis. -
validate_list_of()
has been removed. It hasn't proven to be practically
useful, and isn't used by any packages on CRAN (#1697). -
Directed calls to
vec_c()
, likevec_c(.ptype = <type>)
, now mention the
position of the problematic argument when there are cast errors (#1690). -
list_unchop()
no longer drops names in some cases whenindices
were
supplied (#1689). -
"unique_quiet"
and"universal_quiet"
are newly accepted by
vec_as_names(repair =)
andvec_names2(repair =)
. These options exist to
help users who call these functions indirectly, via another function which
only exposesrepair
but notquiet
. Specifyingrepair = "unique_quiet"
is
like specifyingrepair = "unique", quiet = TRUE
. When the"*_quiet"
options are used, any setting ofquiet
is silently overridden (@jennybc,
#1629)."unique_quiet"
and"universal_quiet"
are also newly accepted for the name
repair argument of several other functions that do not expose aquiet
argument:data_frame()
,df_list()
,vec_c()
,list_unchop()
,
vec_interleave()
,vec_rbind()
, andvec_cbind()
(@jennybc, #1716). -
list_unchop()
has gainederror_call
anderror_arg
arguments (#1641,
#1692). -
vec_c()
has gained.error_call
and.error_arg
arguments (#1641, #1692). -
Improved the performance of list-of common type methods (#1686, #875).
-
The list-of method for
as_list_of()
now places the optional.ptype
argument after the...
(#1686). -
vec_rbind()
now appliesbase::c()
fallback recursively within
packed df-cols (#1331, #1462, #1640). -
vec_c()
,vec_unchop()
, andvec_rbind()
now proxy and restore
recursively (#1107). This preventsvec_restore()
from being called
with partially filled vectors and improves performance (#1217,
#1496). -
New
vec_any_missing()
for quickly determining if a vector has any missing
values (#1672). -
vec_equal_na()
has been renamed tovec_detect_missing()
to align better
with vctrs naming conventions.vec_equal_na()
will stick around for a few
minor versions, but has been formally soft-deprecated (#1672). -
vec_c(outer = c(inner = 1))
now produces correct error messages (#522). -
If a data frame is returned as the proxy from
vec_proxy_equal()
,
vec_proxy_compare()
, orvec_proxy_order()
, then the corresponding proxy
function is now automatically applied recursively along all of the columns.
Additionally, packed data frame columns will be unpacked, and 1 column data
frames will be unwrapped. This ensures that the simplest possible types are
provided to the native C algorithms, improving both correctness and
performance (#1664). -
When used with record vectors,
vec_proxy_compare()
andvec_proxy_order()
now call the correct proxy function while recursing over the fields (#1664). -
The experimental function
vec_list_cast()
has been removed from
the package (#1382). -
Native classes like dates and datetimes now accept dimensions (#1290, #1329).
-
vec_compare()
now throws a more informative error when attempting to compare
complex vectors (#1655). -
vec_rep()
and friends gainerror_call
,x_arg
, andtimes_arg
arguments so they can be embedded in frontends (#1303). -
Record vectors now fail as expected when indexed along dimensions
greater than 1 (#1295). -
vec_order()
andvec_sort()
now have...
between the required and
optional arguments to make them easier to extend (#1647). -
S3 vignette was extended to show how to make the polynomial class
atomic instead of a list (#1030). -
The experimental
n
argument ofvec_restore()
has been
removed. It was only used to inform on the size of data frames in
case a bare list is restored. It is now expected that bare lists be
initialised to data frame so that the size is carried through row
attributes. This makes the generic simpler and fixes some
performance issues (#650). -
The
anyNA()
method forvctrs_vctr
(and thusvctrs_list_of
) now
supports therecursive
argument (#1278). -
vec_as_location()
andnum_as_location()
have gained amissing = "remove"
option (#1595). -
vec_as_location()
no longer matchesNA_character_
and""
indices if
those invalid names appear innames
(#1489). -
vec_unchop()
has been renamed tolist_unchop()
to better indicate that it
requires list input.vec_unchop()
will stick around for a few minor
versions, but has been formally soft-deprecated (#1209). -
Lossy cast errors during scalar subscript validation now have the
correct message (#1606). -
Fixed confusing error message with logical
[[
subscripts (#1608). -
New
vec_rank()
to compute various types of sample ranks (#1600). -
num_as_location()
now throws the right error when there are out-of-bounds
negative values andoob = "extend"
andnegative = "ignore"
are set
(#1614, #1630). -
num_as_location()
now works correctly when a combination ofzero = "error"
andnegative = "invert"
are used (#1612). -
data_frame()
anddf_list()
have gained.error_call
arguments (#1610). -
vec_locate_matches()
has gained anerror_call
argument (#1611). -
"select"
and"relocate"
have been added as valid subscript actions to
support tidyselect and dplyr (#1596). -
num_as_location()
has a newoob = "remove"
argument to remove
out-of-bounds locations (#1595). -
vec_rbind()
andvec_cbind()
now have.error_call
arguments (#1597). -
df_list()
has gained a new.unpack
argument to optionally disable data
frame unpacking (#1616). -
vec_check_list(arg = "")
now throws the correct error (#1604). -
The
difftime
todifftime
vec_cast()
method now standardizes the internal
storage type to double, catching potentially corrupt integer storage
difftime
vectors (#1602). -
vec_as_location2()
andvec_as_subscript2()
more correctly utilize their
call
arguments (#1605). -
vec_count(sort = "count")
now uses a stable sorting method. This ensures
that different keys with the same count are sorted in the order that they
originally appeared in (#1588). -
Lossy cast error conditions now show the correct message when
conditionMessage()
is called on them (#1592). -
Fixed inconsistent reporting of conflicting inputs in
vec_ptype_common()
(#1570). -
vec_ptype_abbr()
andvec_ptype_full()
now suffix 1d arrays
with[1d]
. -
vec_ptype_abbr()
andvec_ptype_full()
methods are no longer
inherited (#1549). -
vec_cast()
now throws the correct error when attempting to cast a subclassed
data frame to a non-data frame type (#1568). -
vec_locate_matches()
now uses a more conservative heuristic when taking the
joint ordering proxy. This allows it to work correctly with sf's sfc vectors
and the classes from the bignum package (#1558). -
An sfc method for
vec_proxy_order()
was added to better support the sf
package. These vectors are generally treated like list-columns even though
they don't explicitly have a"list"
class, and thevec_proxy_order()
method now forwards to the list method to reflect that (#1558). -
vec_proxy_compare()
now works correctly for raw vectors wrapped inI()
.
vec_proxy_order()
now works correctly for raw and list vectors wrapped in
I()
(#1557).
vctrs 0.4.2
- HTML documentation fixes for CRAN checks.