R Last Element Of Period