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
[EMAIL PROTECTED]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to