You can do something like this

> m = matrix(1:144, 12, 12)
> rowRandomIndex = sample(1:12)
> colRandomIndex = sample(1:12)
> m[rowRandomIndex, colRandomIndex]

There must be more elegant ways to do this...but this should work.

Cheers,
--TC

On 3/19/07, prsmra01@uniroma2.it <prsmra01@uniroma2.it> wrote:
>
> Dear All,
>
> It may sound a trivial question...but I couldn't find a simple
> solution in R: I'm working
> on all-against-all distance matrices, the values stored in these
> matrices representing
> measures of similarities between pair of proteins; these matrices can
> be considered
> representation of phylogenetic trees; I want to generate other
> matrices with the same
> randomly permuted distances....how can I shuffle these matrices ?
>
> thank you,
>
> Maria
> --
> Maria Persico, PhD. student
> http://cbm.bio.uniroma2.it/~maria/
> MINT database group
> Universita' di Tor Vergata, via della Ricerca scientifica 11
> 00133 Roma, Italy
> Tel +39 0672594315 (Supervisor's room)
> Fax +39 0672594766
> Mobile phone: +393479715662
> e-mail maria.persico@uniroma2.it
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

