New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected failures when vector inherits from character #497
Comments
Is this issue only about the error message? I think no error is the expected result. |
x <- structure(letters[1:3], class = "foo")
vctrs::vec_match(x, x)
#> [1] 1 2 3
x <- structure(letters[1:3], class = "character")
vctrs::vec_match(x, x)
#> <error/rlang_error>
#> Only bare vectors have shapes.
#> Backtrace:
#> 1. vctrs::vec_match(x, x)
#> 4. vctrs:::vec_ptype2.character.character(...)
#> 5. vctrs:::shape_match(character(), x, y)
#> 6. vctrs:::shape_common(x, y)
#> 8. vctrs:::shape(x) |
lionel-
added a commit
to r-lib/tidyselect
that referenced
this issue
Oct 4, 2019
Until r-lib/vctrs#497 is fixed
hadley
added a commit
that referenced
this issue
Nov 11, 2019
* If neither x nor y are objects, preserve their shape * Otherwise preserve the underlying base type I think this is correct because if the class vector includes (e.g.) "character", that's an assertion that the object is a character vector. To preserve attributes and class, you'd need to provide a vec_ptype2 method. Fixes #497
hadley
added a commit
that referenced
this issue
Nov 12, 2019
* If neither x nor y are objects, preserve their shape * Otherwise preserve the underlying base type I think this is correct because if the class vector includes (e.g.) "character", that's an assertion that the object is a character vector. To preserve attributes and class, you'd need to provide a vec_ptype2 method. Fixes #497
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created on 2019-07-22 by the reprex package (v0.3.0)
From tidyverse/tidyr#676.
The text was updated successfully, but these errors were encountered: