[R] How to refer to the last a few rows?
Bert Gunter
gunter.berton at gene.com
Mon Sep 14 18:16:03 CEST 2009
?nrow
Bert Gunter
Genentech Nonclinical Biostatistics
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Federman, Douglas
Sent: Monday, September 14, 2009 9:03 AM
To: Peng Yu; r-help at stat.math.ethz.ch
Subject: Re: [R] How to refer to the last a few rows?
Try the tail() function
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Peng Yu
Sent: Monday, September 14, 2009 11:32 AM
To: r-help at stat.math.ethz.ch
Subject: [R] How to refer to the last a few rows?
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
______________________________________________
R-help at r-project.org 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.
______________________________________________
R-help at r-project.org 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.
More information about the R-help
mailing list