Davis Vaughan
Davis Vaughan
This is basically the same thing as https://github.com/r-lib/vctrs/issues/1309#issuecomment-760227425 > This is not what I expected The problem is that there is no way to decide what _should_ be expected. You...
> If a can be cast to b, and indeed b can be cast to a, then surely a and b can be cast to a common type Not necessarily....
We will consider adding a double common type for `vec_ptype2(, )` In the meantime, typically when we have a generic function that works with any vector type, like `chop(x, breaks)`,...
If you have: ```r chop(x = 1:10, breaks = c(2.5, 7.5)) ``` And your internal code does ```r vec_cast(breaks, to = x) ``` Then that is an error if the...
Reopening because dplyr relies on this behavior right now in `relocate()`, see https://github.com/r-lib/vctrs/pull/1545
The other idea is to document `vec_unique_loc()` and `vec_unique()` as order _stable_, and just say that the unique value is the first occurrence of that value (similar to the way...
And we could go a step further by adding a `which = c("first", "last")` argument to `vec_unique_loc()`, which would complement https://github.com/r-lib/vctrs/issues/1239 nicely ``` # I think: vec_unique_loc(x, which = "last")...
I'm not sure I understand this metadata thing, can you give me an example?
I would store the metadata in an attribute and make the `vec_proxy()` method promote it to a data frame column (so it gets sliced). And the `vec_proxy_equal()` method would just...
@eutwt in my head that was the reason we exposed `vec_unique_loc()`, so you can do this: ``` r library(vctrs) df a b #> 1 1 a #> 2 2 b...