[R] How to refer to the last a few rows?

Peng Yu pengyu.ut at gmail.com
Mon Sep 14 17:32:09 CEST 2009


Hi,

x=matrix(1:60,nr=6)

I can refer the last 2 rows by
x[5:6,]

If I don't know the total number of rows is 6, is there a way to refer
the last 2 rows?

Regards,
Peng




More information about the R-help mailing list