Mathieu Jérôme
2007-Apr-05 13:34 UTC
[R] permutations of a binary matrix with fixed margins
Dear R Users, How can I randomize a matrix (with contains only 0 and 1) with the constraint that margin totals (columns and rows sums) are kept constant? Some have called this "swap permutation" or something like that. The principle is to find bloc of 10 01 and change it for 01 10 there can be several rows or columns between these numbers. It probably exists in R, but I can't find the function. I am aware of permcont, but it works only for 2x2 matrices thanks in advance Jerome -- J?r?me Mathieu Laboratory of soil tropical ecology UPMC jerome.mathieu at snv.jussieu.fr