first: first

Description Usage Arguments Details Value Author(s) Examples

View source: R/listprocessor.R

Description

Retrieve the first element from list

Usage

1
first(lst)

Arguments

lst

the list to which the first element will be returned

Details

Retrieve and return the first element from a list. This lispy style function uses indexing under the hood but exposes the process as a function call.

Value

the first element

Author(s)

Jay Morgan

Examples

1
2
3
4
5
## Not run: 
(first {1 2 3}) => 1
(first {{1 2} {3 4}}) => list(1, 2)

## End(Not run)

jaypmorgan/slurp documentation built on Dec. 20, 2021, 10 p.m.