nth: nth

Description Usage Arguments Details Value Author(s) Examples

View source: R/listprocessor.R

Description

Return the nth element from a list

Usage

1
nth(lst, n)

Arguments

lst

The list to which the nth element will be returned

n

the index of the element to retrieve

Details

Retrieve the nth element of the list via a function call instead of indexing

Value

the nth element

Author(s)

Jay Morgan

Examples

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

## End(Not run)

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