R/permute.rows.R

Defines functions permute.rows

permute.rows <- function(x) {

    dd <- dim(x)
    n <- dd[1]
    p <- dd[2]
    mm <- runif(length(x)) + rep(seq(n) * 10, rep(p, n))
        
    return(matrix(t(x)[order(mm)], n, p, byrow=TRUE))
        
}

Try the superpc package in your browser

Any scripts or data that you put into this service are public.

superpc documentation built on Oct. 24, 2020, 1:07 a.m.