lag_cols: Lag multiple columns at at time

lag_colsR Documentation

Lag multiple columns at at time

Description

lag_cols is a function that takes a vector of variable names and lags them all.

Usage

lag_cols(data, cols, n = 1)

Arguments

data

Data frame or tibble

cols

Character vector of one or more column names found in data

n

Variable in lag function, number of periods to lag

Details

Used in scripts: Robust function: FALSE

Value

Lagged data frame


AndreSjuve/dretools documentation built on Dec. 4, 2024, 3:12 a.m.