Learn R Programming

locits (version 1.7.1)

zeropad: 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.

Value

x and whose even elements are zeroes.

Details

Title says it all.

See Also

hwt

Examples

Run this code
#
# Operate on a test set
#
v <- 1:3
zeropad(v)
#[1] 1 0 2 0 3 0

Run the code above in your browser using DataLab