last: Last element of a vector or list

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/last.R

Description

Returns the last element of a list or vector.

Usage

1
last(x)

Arguments

x

a list or vector.

Details

Designed to be faster than using tail() or rev(), and cleaner than writing x[length(x)].

Value

An object of the same type as x of length 1 (or empty if x is empty).

Author(s)

Robin Evans

See Also

tail, rev.

Examples

1
last(1:10)

rje42/rje documentation built on Aug. 15, 2017, 7:43 a.m.

Related to last in rje42/rje...