Introduced in #803, breaks as of d8efb4f, works in 361667d = d8efb4f^.
.rando <- setClass("rando", contains = "numeric", slots = list(.Data = "numeric"))
rando <- function(n = 0) {
.rando(as.numeric(seq_len(n)))
}
as_rando <- function(x) {
rando(length(x))
}
setMethod("[", "rando", function(x, i, j, ..., drop = TRUE) {
new_n <- length(vec_as_location(i, length(x@.Data), names(x@.Data)))
rando(new_n)
})
library(vctrs)
vec_c(rando(), rando())
#> Error: Can't find vctrs or base methods for concatenation.
#> vctrs methods must be implemented for class `rando`.
#> See <https://vctrs.r-lib.org/articles/s3-vector.html>.
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:vctrs':
#>
#> new_duration
#> The following object is masked from 'package:base':
#>
#> date
x <- interval(today(), today())
vec_c(x, x)
#> Error: Can't find vctrs or base methods for concatenation.
#> vctrs methods must be implemented for class `Interval`.
#> See <https://vctrs.r-lib.org/articles/s3-vector.html>.
Created on 2020-03-15 by the reprex package (v0.3.0)
Introduced in #803, breaks as of d8efb4f, works in 361667d = d8efb4f^.
Created on 2020-03-15 by the reprex package (v0.3.0)