Learn R Programming

multiplyr (version 0.1.1)

nth: Return the nth item from a vector

Description

Return the nth item from a vector

Usage

nth(x, n, default = NA)

Arguments

x
Vector
n
The n in nth
default
Value to pad missing data with

Value

nth item from vector

See Also

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

Examples

Run this code
nth (1:10, 5)
nth (1:10, 11, default=123)

Run the code above in your browser using DataLab