sumlagdiff: Create a score that measures the absolute fluctuation for a...

View source: R/sumlagdiff.R

sumlagdiffR Documentation

Create a score that measures the absolute fluctuation for a numeric vector

Description

Returns the sum of absolute differences for each value in a vector, between k and k-1.

Usage

sumlagdiff(x, na.rm = FALSE)

Arguments

x

numeric

na.rm

logical. Should missing values (including NaN) be removed?

Examples

p <- c(3, 5, 4, 2, 1, 7)
q <- c(4, 4, 3, 3, 4, 4)
sumlagdiff(p)
sumlagdiff(q)


martinctc/tstoolbox documentation built on Nov. 20, 2024, 3:55 p.m.