[R] matrix export

From: Eric Pante <ericpante_at_hotmail.com>
Date: Fri 20 Jan 2006 - 05:08:32 EST

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

______________________________________________
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.html Received on Fri Jan 20 05:28:15 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:07 EST