R/permute.rows.R

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

Try the rda package in your browser

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

rda documentation built on Feb. 16, 2023, 8:15 p.m.