Learn R Programming

mlr3misc (version 0.15.0)

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

Value

(list()) with vectors of same size.

Arguments

.x

(list()).

Examples

Run this code
recycle_vectors(list(a = 1:3, b = 2))

Run the code above in your browser using DataLab