Re: [R] reverse order of matrix rows

From: Jean Eid <jeaneid_at_chass.utoronto.ca>
Date: Tue 09 Aug 2005 - 09:44:12 EST


sapply(nrow(matrix):1, function(x) matrix[x,])

On Mon, 8 Aug 2005, Jake wrote:

> Quick question: how can I reverse the order of the rows in a matrix?
> i.e. make the last row first and the first row last, etc.?
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Aug 09 09:39:36 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:45 EST