Recycle: Recyle a List of Elements

View source: R/DescTools.r

RecycleR Documentation

Recyle a List of Elements

Description

This function recycles all supplied elments to the maximal dimension.

Usage

Recycle(...)

Arguments

...

a number of vectors of elements.

Value

a list of the supplied elements
attr(,"maxdim") contains the maximal dimension of the recyled list

Author(s)

Andri Signorell <andri@signorell.net>

See Also

rep, replicate

Examples

Recycle(x=1:5, y=1, s=letters[1:2])

z <- Recycle(x=letters[1:5], n=2:3, sep=c("-"," "))
sapply(1:attr(z, "maxdim"), function(i) paste(rep(z$x[i], times=z$n[i]), collapse=z$sep[i]))

AndriSignorell/DescTools documentation built on Nov. 11, 2024, 12:11 p.m.