Learn R Programming

multiplyr (version 0.1.1)

first: Returns first value in vector

Description

Returns first value in vector

Usage

first(x, default = NA)

Arguments

x
Vector
default
Value to pad missing data with

Value

First value in x

See Also

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

Examples

Run this code
first (1:10)
first (numeric(0), default=123)

Run the code above in your browser using DataLab