[R] write table and dinnames

AlessandroSemeria@cramont.it AlessandroSemeria at cramont.it
Mon Nov 4 12:35:31 CET 2002


I would write in tab-text file a table like this one:

TAB  colname1 TAB   colname2  TAB   TAB...         colnameN
rowname1  #    #              #
rowname2  #    #              #


rownameM  #    #              #

then I wrote something like:
     mymatrix <- matrix(nrow=M,ncol=N,byrow=T)
     rownames(mymatrix) <- chvector1
     colnames(mymatrix) <- chvector2
     write.table(mymatrix,file=myfile,sep="\t").

But I obtained:


colname1 TAB   colname2  TAB   TAB...         colnameN
rowname1  #    #              #
rowname2  #    #              #


rownameM  #    #              #

How to put in first column a TAB ("\t")?
Thanks in advance?
------------------------------------------------------------
Sincerely yours.

Dr. Alessandro Semeria                             Tel. +39 544 536811
Models and Simulation Lab of                                 Fax. +39 544
538663
The Environment Research Center - Montecatini (Edison Group),
E-mail: asemeria at cramont.it
Via Ciro Menotti 48,
48023 Marina di Ravenna (RA), Italy



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list