Extract or replace the ultimate (last) element of a vector or a list, or an element counting from the end.