Learn R Programming

mixAR (version 0.22.8)

permn_cols: All permutations of the columns of a matrix

Description

All permutations of the columns of a matrix

Usage

permn_cols(m)

Value

a list with one element for each permutation of the columns. Each element of the list is an unnamed list with two components:

  1. the permutation, a vector of positive integers,

  2. a matrix obtained by permuting the columns of m.

Arguments

m

a matrix

Author

Georgi N. Boshnakov

Details

This function is a wrapper for permn from package `combinat'.

Examples

Run this code
m <- matrix(c(11:14,21:24,31:34), ncol=3)
pm <- permn_cols(m)
pm[[2]]

Run the code above in your browser using DataLab