sumlagdiff | R Documentation |
Returns the sum of absolute differences for each value in a vector, between k and k-1.
sumlagdiff(x, na.rm = FALSE)
x |
numeric |
na.rm |
logical. Should missing values (including NaN) be removed? |
p <- c(3, 5, 4, 2, 1, 7)
q <- c(4, 4, 3, 3, 4, 4)
sumlagdiff(p)
sumlagdiff(q)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.