zeropad {locits} | R Documentation |
Intersperse zeroes in a vector.
Description
Take a vector of any length and then intersperse zeroes between existing elements (and add a further zero to the end).
Usage
zeropad(x)
Arguments
x |
Vector that you want to intersperse zeros into. |
Details
Title says it all.
Value
A vector whose odd elements are just x
and whose
even elements are zeroes.
Author(s)
G.P. Nason
See Also
Examples
#
# Operate on a test set
#
v <- 1:3
zeropad(v)
#[1] 1 0 2 0 3 0
[Package locits version 1.7.7 Index]