Skip to content

Duplicate and concatenate a series

Source code

Description

Note that this function doesn’t exist in Python Polars.

Usage

<Series>$rep(n, rechunk = TRUE)

Arguments

n Number of times to repeat
rechunk If TRUE (default), reallocate object in memory which can speed up some calculations. If FALSE, the Series will take less space in memory.

Value

Series

Examples

library("polars")

as_polars_series(1:2, "bob")$rep(3)
#> polars Series: shape: (6,)
#> Series: 'bob' [i32]
#> [
#>  1
#>  2
#>  1
#>  2
#>  1
#>  2
#> ]