last | R Documentation |
Just a simple shorthand to get the last, non-missing argument per default.
Can give more than one element and can include missing elements.
The inverse of first()
.
last(x, n = 1, na.rm = TRUE)
x |
vector of which you want the last element |
n |
number of elements to take from the end |
na.rm |
whether to remove missings first, defaults to TRUE |
last( c(1:10,NA) )
last( c(1:10,NA), 2, TRUE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.