[R] permutation of rows of a matrix

Ramón Casero Cañas 8-T at gmx.net
Sat Apr 15 15:22:22 CEST 2006


javargas wrote:
> How can I generate a random permutation between rows of a matrix M (of m rows 
> and n columns)?

maybe

M[ sample(1:m), ]

-- 
Ramón Casero Cañas

http://www.robots.ox.ac.uk/~rcasero/wiki
http://www.robots.ox.ac.uk/~rcasero/blog




More information about the R-help mailing list