Repeat a Series
Description
This expression takes input and repeats it n times and append chunk.
Usage
<Expr>$rep(n, rechunk = TRUE)
Arguments
n
|
The number of times to repeat, must be non-negative and finite. |
rechunk
|
If TRUE (default), memory layout will be rewritten.
|
Details
If the input has length 1, this uses a special faster implementation
that doesn’t require rechunking (so rechunk = TRUE
has no
effect).
Value
Expr
Examples
#> shape: (3, 1)
#> ┌─────────┐
#> │ literal │
#> │ --- │
#> │ str │
#> ╞═════════╡
#> │ alice │
#> │ alice │
#> │ alice │
#> └─────────┘
#> shape: (6, 1)
#> ┌─────┐
#> │ │
#> │ --- │
#> │ i32 │
#> ╞═════╡
#> │ 1 │
#> │ 2 │
#> │ 3 │
#> │ 1 │
#> │ 2 │
#> │ 3 │
#> └─────┘