rowperm {permax}R Documentation

Generates random permutations within rows of a matrix

Description

Given a matrix x, returns a copy of x with a separate random permutations applied within each row.

Usage

rowperm(x)

Arguments

x a numeric matrix A numeric matrix with each row containing the elements from the corresponding row of x permuted in a random order.

Examples

 x <- matrix(1:12,3)
 x
#     [,1] [,2] [,3] [,4] 
#[1,]    1    4    7   10
#[2,]    2    5    8   11
#[3,]    3    6    9   12
  rowperm(x)
#     [,1] [,2] [,3] [,4] 
#[1,]   10    7    1    4
#[2,]    8   11    2    5
#[3,]    6   12    9    3


[Package permax version 1.2.1 Index]