[R] matrix export

Eric Pante ericpante at hotmail.com
Thu Jan 19 19:08:32 CET 2006


Dear listers,

I need to export a distance matrix in the following format :

a 0.0 1.0 0.2 1.0 1.0
b 1.0 0.0 1.0 1.0 1.0
c 0.2 1.0 0.0 1.0 1.0
d 1.0 1.0 1.0 0.0 1.0
e 1.0 1.0 1.0 1.0 0.0

I tried write.matrix() from the MASS library, which gives:

a b c d e
0.0 1.0 0.2 1.0 1.0
1.0 0.0 1.0 1.0 1.0
0.2 1.0 0.0 1.0 1.0
1.0 1.0 1.0 0.0 1.0
1.0 1.0 1.0 1.0 0.0

Does anyone know of an R trick to change the location of the headers 
?or do I need to do this externally, through perl or bash ?

Thanks in advance for your help,
Eric


Eric Pante
----------------------------------------------------------------
College of Charleston, Grice Marine Laboratory
205 Fort Johnson Road, Charleston SC 29412
----------------------------------------------------------------

	"On ne force pas la curiosite, on l'eveille ..."
	Daniel Pennac




More information about the R-help mailing list