Interleave two vectors of arbitrary length.

1 | ```
interleave(x, y)
``` |

`x` |
first vector to interleave. |

`y` |
second vector to interleave. |

`x`

and `y`

need not be of the same length nor of the same class.

An interleaved vector.

Antoine Filipovic Pierucci

Original function posted on R-help by Bogdan Romocea.

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)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.