powered by
All permutations of the columns of a matrix
permn_cols(m)
a list with one element for each permutation of the columns. Each element of the list is an unnamed list with two components:
the permutation, a vector of positive integers,
a matrix obtained by permuting the columns of m.
m
a matrix
Georgi N. Boshnakov
This function is a wrapper for permn from package `combinat'.
permn
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