I need to write a data frame along with its column and row names to a text 
file. However, the first row in the text file is always short of one element. I 
have tried setting different parameters to write.table but that didn't help.

> m
   A B
C 1 2
D 3 4

Using write.table(m, "table.xls", sep="\t", col.names=T, row.names=T) gives

A B
C 1 2
D 3 4

______________________________________________
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