Hi Lauri,

here is a little modification of the solution for retrieving the last 
row only :


score[as.vector(unlist(tapply(rownames(score), score$id, tail, 2))),]


giving the last two rows. Replacing 2 by 6 or 10 gives you the last 6 
or 10 rows (if they exist).


Christian

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to