[R] adding column of ordered numbers to matrix

From: Assa Yeroslaviz <frymor_at_gmail.com>
Date: Thu, 10 Jun 2010 15:56:06 +0200


Hello everyone,

I have a matrix of over 40000 line and about 30 columns.

For my analysis I would like to add another column with ascending numbers (column header should be "order", and than 1,2,3,4 ....the end of the matrix).
During my analysis I reorder them ( due to merge commands by a different column).

How do I add such a column in an ascending order (or descending for what it matters)?

THX Assa

        [[alternative HTML version deleted]]



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. Received on Thu 10 Jun 2010 - 13:58:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 Jun 2010 - 17:50:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive