intercalate: Intercalate list values into a vector

intercalateR Documentation

Intercalate list values into a vector

Description

Intercalate list values into a vector

Usage

intercalate(...)

Arguments

...

parameters are expected as multiple vectors.

Details

This function takes a list of vectors, and intercalates them by inserting alternating values from each vector to make one combined vector. It is analogous to shuffling a deck of cards, except that there could be more than two stacks of cards shuffled together.

Value

vector of values derived from each input list ..., with one element per list in order. In the event any list is shorter than the others, its values are recycled so each list is equal length.

See Also

Other jam list functions: list2im()

Examples

A <- LETTERS[1:10];
B <- letters[1:10];
intercalate(A, B)


jmw86069/splicejam documentation built on April 21, 2024, 4:57 p.m.