recycle_vectors: Recycle List of Vectors to Common Length

View source: R/recycle_vector.R

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

mlr3misc documentation built on Sept. 20, 2023, 5:06 p.m.