Learn R Programming

assertive (version 0.3-0)

recycle: Recycle arguments

Description

Explicit recycling of arguments to make them all have the same length.

Usage

recycle(...)

Arguments

...
Arguments, usually vectors.

Value

  • A list of vectors, all with the same length.

See Also

rep_len.

Examples

Run this code
# z is the longest argument, with 6 elements
recycle(x = 1:4, y = list(a = month.abb, b = pi), z = matrix(1:6, nrow = 3))

Run the code above in your browser using DataLab