[R] reset row numbers when extracting a subset of a table

naw3 at duke.edu naw3 at duke.edu
Tue Jun 24 17:23:56 CEST 2008


Hi

I created a new table by extracting only certain rows of table, but the row
numbers in my new table correspond to those from the original table. Is there a
way to reset the row numbers in my new table so that they start from one? like
below:

my table:
    COL1   COL2
17   v      45
18   b      14
25   x      98

desired:
   COL1   COL2
1   v      45
2   b      14
3   x      98

Thank you!
-Nina



More information about the R-help mailing list