Skip to content
Prev 24939 / 398502 Next

write table and dinnames

Hi,
On Mon, 4 Nov 2002 AlessandroSemeria at cramont.it wrote:
|I would write in tab-text file a table like this one:
  |
  |TAB  colname1 TAB   colname2  TAB   TAB...         colnameN
  |rowname1  #    #              #
  |rowname2  #    #              #

I do not know any perfect solution.  But you may consider:

1) add the missing tab by a text editor manually (or by a shell script).

2) If you are going to read the table later by R, then you really do not
need the tab

3) write the names with the tab to the file and thereafter append the table
to it.  Something like

write.table(c("", names.matrix), sep="\t")
wirite.table(matrix, col.names=FALSE, append=TRUE)

4) write a tab to the file (eg, by write()) and thereafter append the table to it in the
usual form.



Perhaps it helps. 

Best wishes,

Ott