apply_lag: apply_lag

Description Usage Arguments Value Author(s) See Also Examples

Description

lag some of the columns in a data.frame

Usage

1
apply_lag(data, hold, move, lag = 0)

Arguments

data

a data.frame to operate over

hold

a vector of column names to hold steady

move

a vector of column names to lag

lag

the number of rows to lag by

Value

the laged data.frame

Author(s)

Mark Newman, mark@trinetteandmark.com

See Also

Other utilities: adjust_grid_for_regression, force_categorical, identify_variables

Examples

1
2
3
4
5
6
  
  data.frame(
    a = c(1,2,3,4),
    b = c(2,3,4,5),
    c = c(4,5,6,7)) %>%
    apply_lag(hold = "a", move = "b", lag = 1)

markanewman/mndredge documentation built on May 9, 2019, 5:52 a.m.