Skip to contents

Repeats all vectors of a list .x to the length of the longest vector using rep() with argument length.out. This operation will only work if the length of the longest vectors is an integer multiple of all shorter vectors, and will throw an exception otherwise.

Usage

recycle_vectors(.x)

Arguments

.x

(list()).

Value

(list()) with vectors of same size.

Examples

recycle_vectors(list(a = 1:3, b = 2))
#> $a
#> [1] 1 2 3
#> 
#> $b
#> [1] 2 2 2
#>