tests/testthat/_snaps/type-asis.md

AsIs objects throw ptype2 errors with their underlying types

Code
  (expect_error(vec_ptype2(I(1), I("x")), class = "vctrs_error_incompatible_type")
  )
Output
  <error/vctrs_error_ptype2>
  Error:
  ! Can't combine `I(1)` <double> and `I("x")` <character>.

AsIs objects throw cast errors with their underlying types

Code
  (expect_error(vec_cast(I(1), I(factor("x"))), class = "vctrs_error_incompatible_type")
  )
Output
  <error/vctrs_error_cast>
  Error:
  ! Can't convert `I(1)` <double> to <factor<bf275>>.


Try the vctrs package in your browser

Any scripts or data that you put into this service are public.

vctrs documentation built on Oct. 13, 2023, 1:05 a.m.