Learn R Programming

multiplyr (version 0.1.1)

lead: Offset x forwards by n

Description

Offset x forwards by n

Usage

lead(x, n = 1, default = NA)

Arguments

x
Vector
n
Amount of offset by
default
Value to pad missing data with

Value

Offset values

See Also

Other utility functions: between, cumall, cumany, cummean, distribute, first, lag, last, n_distinct, n_groups, nth, n

Examples

Run this code
lead (1:10)
lead (1:10, 2)

Run the code above in your browser using DataLab