Learn R Programming

ecd (version 0.9.2.4)

ecd.lag: Utility to shift a vector of numeric or mpfr

Description

This utility is basically the same as Hmisc::Lag, but it handles mpfr vector properly.

Usage

ecd.lag(x, shift = 1, na.omit = FALSE)

Arguments

x

a vector of numeric or mpfr

shift

integer, cells to shift

na.omit

logical, whether to remove the NAs

Value

the shifted vector

Examples

Run this code
# NOT RUN {
x <- ecd.lag(c(1,2,3))
y <- ecd.lag(ecd.mpfr(c(1,2,3)))
# }

Run the code above in your browser using DataLab