zeropad | R Documentation |
Take a vector of any length and then intersperse zeroes between existing elements (and add a further zero to the end).
zeropad(x)
x |
Vector that you want to intersperse zeros into. |
Title says it all.
A vector whose odd elements are just x
and whose
even elements are zeroes.
G.P. Nason
hwt
#
# Operate on a test set
#
v <- 1:3
zeropad(v)
#[1] 1 0 2 0 3 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.