You can try the following:
my.df[ nrow(my.df) %% 2 == 0, ]
for selecting even lines or == 1 for odd lines.
-Christos
-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu
[mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of Khan, Sohail
Sent: Friday, April 21, 2006 11:46 AM
To: s-news@lists.biostat.wustl.edu
Subject: [S] Selecting every other line from a data frame
Dear All,
I have a large data frame, from which I want to only select every other line
or odd lines.
How can I do this? Thanks.
Sohail Khan
Scientific Programmer
COLD SPRING HARBOR LABORATORY
Genome Research Center
500 Sunnyside Boulevard
Woodbury, NY 11797
(516)422-4076
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with the
BODY of the message: unsubscribe s-news
|