Extract or replace the *ult*imate (last) element of a vector or a list, or an element counting from the end.
Extract or replace the *ult*imate (last) element of a vector or a list, or an element counting from the end.
ult(x, i = 1L)
x |
a vector or a list. |
i |
index from the end of the list to extract or replace (where 1 is the last element, 2 is the penultimate element, etc.). |
An element of 'x'.
x <- 1:5 (last <- ult(x)) (penultimate <- ult(x, 2)) # 2nd last.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.