Displaying 1 result from an estimated 1 matches for "mathieu_at_snv".
2007 Oct 02
1
permutations of a binary matrix with fixed margins
...| all(query==1-pattern)) &&
runif(1)<0.5)
x[c(i,ii),c(j,jj)] <- 1 - x[c(i,ii),c(j,jj)]
}
x
}
###############################################################
--------------------------------------------------------
From: Mathieu J?r?me <jerome.mathieu_at_snv.jussieu.fr>
Date: Thu 05 Apr 2007 - 13:34:01 GMT
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 principl...