rep2abI(x, times)
conceptually computes
rep.int(x, times)
but with an
abIndex
class result.
Arguments
- x
numeric vector
- times
integer (valued) scalar: the number of repetitions
Examples
(ab <- rep2abI(2:7, 4))
#> Abstract Index vector (class 'abIndex') of length 24, kind "rleDiff"
#> and slot "rleD":
#> RLE difference (class 'rleDiff'): first = 2, "rle":
#> Run Length Encoding
#> lengths: int [1:7] 5 1 5 1 5 1 5
#> values : int [1:7] 1 -5 1 -5 1 -5 1
stopifnot(identical(as(ab, "numeric"),
rep(2:7, 4)))