Learn R Programming

PMmisc (version 0.1.0)

flag: Create a lag variable

Description

Create a lag variable, with a choice of lag periods. The lag variable can be used to test lag effects between variables.

Usage

flag(x,n)

Arguments

x

:a vector

n

:number of lag periods

Examples

Run this code
# NOT RUN {
flag(mtcars[,2],3)
# }

Run the code above in your browser using DataLab