gt;
> Can someone teach me how to do this? Thanks very much.
>
> - Bobby
>
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.h
really not sure
that they are implemented in R.
Sincerely,
Finny Kuruvilla wrote:
Hi Nick,
This way isn't the most elegant but works well, especially if the
matrices aren't too large:
# This function works on 2x2 arrays, randomizing them, but
# preserving row and column tota
ple:
> a=array(sample(c(0,1),10,replace=TRUE),dim=c(5,2))
> a
[,1] [,2]
[1,]01
[2,]11
[3,]01
[4,]01
[5,]10
> shuffle_matrix(a)
[,1] [,2]
[1,]01
[2,]11
[3,]10
[4,] 0 1
[5,]
Another similar way to do this using apply is:
apply(ar1==ar2,1,all)
Best,
Finny Kuruvilla
*
Finny Kuruvilla, MD, PhD
Harvard Medical School Fellowship Program in Transfusion Medicine
Broad Institute of MIT and Harvard
Homepage
be a priori?
Thanks,
Finny Kuruvilla
*
Finny Kuruvilla, MD, PhD
Harvard Medical School Fellowship Program in Transfusion Medicine
Broad Institute of MIT and Harvard
Homepage: http://www.people.fas.harvard.edu/~kuruvill