diff_by_ID: First-order difference for grouped data

View source: R/diff_by_ID.R

diff_by_IDR Documentation

First-order difference for grouped data

Description

First-order difference for grouped data

Usage

diff_by_ID(x, ID, ...)

Arguments

x

Vector of values

ID

Vector of group IDs, of same length as x

...

Optional parameters passed to difftime, if x is a vector of dates

Value

Vector of same length as x of first-order differences of x (and NAs for last value of each group ID)


TheoMichelot/utilTM documentation built on April 14, 2025, 12:52 p.m.