interleave: Interleave values from two vectors

Description Usage Arguments Value Examples

Description

Interleave values from two vectors

Usage

1
interleave(x, y)

Arguments

x

First vector, will fill the odd elements of the result. May be of any mode, e.g. numeric, character, logical, etc.

y

Second vector, will fill the even elements of the result. Must match the mode and length of x

Value

A vector of x and y interleaved.

Examples

1
2
interleave(x=seq(from=1, by=2, length.out=5), y=seq(from=2, by=2, length.out=5))
interleave(x=rep(TRUE, 3), y=rep(FALSE, 3))

nicolaroberts/nrmisc documentation built on May 23, 2019, 5:09 p.m.