Vectors in %in% Fails
latot opened this issue · comments
latot commented
Hi, I'm pretty new using vctrs, still I was able to do some basics in a lib, I'm mainly following https://vctrs.r-lib.org/articles/s3-vector.html#equality-and-comparison
Rn, I found that we can't use %in%
:
node <- function(x) {
vctrs::new_vctr(x, class = "node")
}
data <- node(c(1, 2, 3))
data[[1]] %in% data
Error in `as.character()`:
! Can't convert `x` <node> to <character>.
Run `rlang::last_trace()` to see where the error occurred.
Is this the right way to do it? or is a bug?
Thx!
Davis Vaughan commented
We should probably provide a definition for the new mtfrm()
S3 generic if we can, used by match()
and therefore %in%
.
In the meantime you can use vctrs::vec_in()
instead