interleave: Interleave elements of shorter vectors (or lists) between...

Description Usage Arguments Value Examples

View source: R/interleave.R

Description

Arranges elements of argument vectors or lists so that the first elements of all arguments get output then the second ones etc. Arguments are reused to match the length of the largest argument minus 1.

Usage

1

Arguments

...

vertors or lists to be interleaved

Value

interleaved vector or list

Examples

1
2
3
4
5
6
7
8
interleave(1:3, 0)
# [1] 1 0 2 0 3

interleave(1:3, -1:0, 11:14)
# [1]  1 -1 11  2  0 12  3 -1 13  1  0 14

interleave(LETTERS[1:3], "_", letters[1:3], "|") 
# [1] "A" "_" "a" "|" "B" "_" "b" "|" "C" "_" "c"

avidclam/avidstart documentation built on May 17, 2019, 10:01 a.m.