Hi,

The first line has less elements than the rest of
'rownames_colnames.write.table.xls'. I am wondering if there is a way
to print an additional '\t' at the beginning of the first line.

$ Rscript write.table.R
> x=matrix(1:20,nc=2)
> rownames(x)=letters[1:10]
> colnames(x)=letters[1:2]
> write.table(x,"rownames_colnames.write.table.xls",sep='\t')
>
$ cat rownames_colnames.write.table.xls
"a"     "b"
"a"     1       11
"b"     2       12
"c"     3       13
"d"     4       14
"e"     5       15
"f"     6       16
"g"     7       17
"h"     8       18
"i"     9       19
"j"     10      20

Regards,
Peng

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to