last: Get the last element of a vector

View source: R/last.R

lastR Documentation

Get the last element of a vector

Description

last extracts the last element of a vector, matrix or list

Usage

last(x)

Arguments

x

A vector, matrix or list

Value

A single value or list element

Examples

x <- 1:4
last(x)

x <- c("my", "name", "is", "buttons")
last(x)

x <- matrix(runif(10), 5, 2)
last(x)

x <- matrix(LETTERS[1:10], 5, 2)
last(x)

x <- list(1:5, 6:10)
last(x)


edsandorf/gizmo documentation built on Oct. 7, 2022, 3:45 p.m.