[R] shuffling a vector
MSchwartz at medanalytics.com
Mon Nov 10 17:51:42 CET 2003
On Mon, 2003-11-10 at 10:28, Rajarshi Guha wrote:
> I'me trying to write a function that will shuffle a vector. At the
> moment I'm baically making a vector of randomized indices and then
> making a new vector from the original one using these random indices.
> However, is there an alternative (more elegant) method to do this? I
> tried help.search('shuffle') but it does'nt return anything relevant.
You might want to look at the permute() function in the 'gregmisc'
> x <- 1:10
 1 3 2 6 5 7 10 8 9 4
More information about the R-help