randpermut {randRotation} | R Documentation

## Generate random permutation matrix for n samples

### Description

Generate a random permutation matrix for `n` samples.

### Usage

    randpermut(n)

### Arguments

`n` | Number of samples

### Details

This methods generates an orthogonal matrix with only one entry in each row and column being `1`, all other entries being `0`.

### Value

A random permutation matrix of dimension `n x n`

### Author(s)

Peter Hettegger

### Examples

    tmp1 <- randpermut(5)
    t(tmp1) %*% tmp1

[Package randRotation version 1.6.0 Index]