R Select Last Value Of Vector