Learn R Programming

cooltools (version 2.4)

last: Last element of a vector

Description

Returns the last element of a vector or the n-th element counting from the end of a vector.

Usage

last(x, n = 1)

Value

scalar of the same type as x

Arguments

x

vector

n

optional integer specifying the n-th element from the end to be returned

Author

Danail Obreschkow