vctrs breaking changes

cran

19 curated breaking changes across major versions of vctrs. Use this as a migration checklist before bumping dependencies.

19
changes
Breaking changes by transition
  • v0.6.5 \u2192 v0.7.0breaking

    R >=4.0.0 is now required. This is still more permissive than the general tidyverse policy of supporting the [5 most recent versions of R](https://tidyverse.org/blog/2019/04/r-version-support/).

  • v0.6.5 \u2192 v0.7.0breaking

    `obj_is_list()` now returns `FALSE` for list arrays. Functions such as `list_drop_empty()` and `list_combine()` validate their input using `obj_is_list()`, but aren't well defined on list arrays.

  • v0.6.5 \u2192 v0.7.0breaking

    Assigning `NULL` into a `<list_of>` via `x[[i]] <- NULL` now shortens the list to better align with base R and the existing `$<-` and `[<-` methods (#2112).

  • v0.6.5 \u2192 v0.7.0breaking

    `as_list_of()` on an existing `<list_of>` no longer has a `.ptype` argument for changing the type on the fly, as this feels incompatible with the new system that allows restricting both the type and size. If you really need this, coerce to a bare list with `as.list()` first, then coerce back to a `<list_of>` using the `<list>` method of `as_list_of()`.

  • v0.6.5 \u2192 v0.7.0breaking

    Experimental "partial" type support has been removed. This idea never panned out and was not widely used. The following functions have been removed (#2101):

  • v0.2.4 \u2192 v0.3.0breaking

    Double-dispatch methods for `vec_ptype2()` and `vec_cast()` are no longer inherited (#710). Class implementers must implement one set of methods for each compatible class. For example, a tibble subclass no longer inherits from the `vec_ptype2()` methods between `tbl_df` and `data.frame`. This means that you explicitly need to implement `vec_ptype2()` methods with `tbl_df` and `data.frame`. This change requires a bit more work from class maintainers but is safer because the coercion hierarchies a

  • v0.2.4 \u2192 v0.3.0breaking

    `vec_cast()` is now restricted to the same conversions as `vec_ptype2()` methods (#606, #741). This change is motivated by safety and performance:

  • v0.2.4 \u2192 v0.3.0breaking

    It is generally sloppy to generically convert arbitrary inputs to one type. Restricted coercions are more predictable and allow your code to fail earlier when there is a type issue.

  • v0.2.4 \u2192 v0.3.0breaking

    When unrestricted conversions are useful, this is generally towards a known type. For example, `glue::glue()` needs to convert arbitrary inputs to the known character type. In this case, using double dispatch instead of a single dispatch generic like `as.character()` is wasteful.

  • v0.2.4 \u2192 v0.3.0breaking

    To implement the useful semantics of coercible casts (already used in `vec_assign()`), two double dispatch were needed. Now it can be done with one double dispatch by calling `vec_cast()` directly.

  • v0.2.3 \u2192 v0.2.4breaking

    `numeric_version` and `package_version` lists are now treated as vectors (#723).

  • v0.2.3 \u2192 v0.2.4breaking

    `vec_slice()` now properly handles symbols and S3 subscripts.

  • v0.2.3 \u2192 v0.2.4breaking

    `vec_as_location()` and `vec_as_subscript()` are now fully implemented in C for efficiency.

  • v0.2.3 \u2192 v0.2.4breaking

    `num_as_location()` gains a new argument, `zero`, for controlling whether to `"remove"`, `"ignore"`, or `"error"` on zero values (#852).

  • unknown \u2192 v0.2.0breaking

    Lossy casts now throw errors of type `vctrs_error_cast_lossy`. Previously these were warnings. You can suppress these errors selectively with `allow_lossy_cast()` to get the partial cast results. To implement your own lossy cast operation, call the new exported function `maybe_lossy_cast()`.

  • unknown \u2192 v0.2.0breaking

    `vec_c()` now fails when an input is supplied with a name but has internal names or is length > 1: ``` vec_c(foo = c(a = 1)) #> Error: Can't merge the outer name `foo` with a named vector. #> Please supply a `.name_spec` specification. vec_c(foo = 1:3) #> Error: Can't merge the outer name `foo` with a vector of length > 1. #> Please supply a `.name_spec` specification. ``` You can supply a name specification that describes how to combine the external name of the input with its internal names or

  • unknown \u2192 v0.2.0breaking

    `vec_empty()` has been renamed to `vec_is_empty()`.

  • unknown \u2192 v0.2.0breaking

    `vec_dim()` and `vec_dims()` are no longer exported.

  • unknown \u2192 v0.2.0breaking

    `vec_na()` has been renamed to `vec_init()`, as the primary use case is to initialize an output container.

API access

Get this data programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/breaking/cran/vctrs
vctrs breaking changes — CRAN migration guide | DepScope