R: Recycle List of Vectors to Common Length

recycle_vectors {mlr3misc} | R Documentation

## Recycle List of Vectors to Common Length

### Description

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))

[Package mlr3misc version 0.10.0 Index]