diffPad: Difference Function with Padding

View source: R/other_functions.R

diffPadR Documentation

Difference Function with Padding

Description

This function takes the first difference of a given time series data or vector and pads it with the selected lag length while maintaining the attributes of the input data. ts object or vector can be used.

Usage

diffPad(x)

Arguments

x

ts object or numeric vector.

Value

A first difference taken ts object or numeric vector with padding.

Author(s)

Omer Kara

Examples

values <- c(1:10)
x <- values
x.ts <- ts(data.frame(V1 = values))
diffPad(x)
diffPad(x.ts)


omerkara/okara documentation built on Nov. 21, 2023, 7:56 p.m.