filldiff: NA-filled diff

Description Usage Arguments Details Value

Description

Applies the diff function but pads it with NAs to retain original length.

Usage

1
filldiff(x, gap = 1)

Arguments

x

a vector of any type diff is happy with

gap

the gap to be passed to diff

Details

When the gap is an odd number the extra NA goes at the start.

Value

A difference vector with NAs introduced to make it up to the same size as the input


PaolaCognigni/CTraxHelper documentation built on May 7, 2019, 11:57 p.m.