interleave: Interleave vectors

Description Usage Arguments Details Value Author(s) References Examples

View source: R/utils.R

Description

Interleave two vectors of arbitrary length.

Usage

1
interleave(x, y)

Arguments

x

first vector to interleave.

y

second vector to interleave.

Details

x and y need not be of the same length nor of the same class.

Value

An interleaved vector.

Author(s)

Antoine Filipovic Pierucci

References

Original function posted on R-help by Bogdan Romocea.

Examples

1
2
3
4
5
6
7
8
9
# same length
a <- letters[1:5]
b <- letters[10:15]
interleave(a, b)

# different length
x <- letters[1:2]
y <- letters[10:15]
interleave(x, y)

rmngb documentation built on May 29, 2017, 9:22 p.m.

Search within the rmngb package
Search all R packages, documentation and source code