From gregory_r_warnes at groton.pfizer.com  Thu Mar  6 15:06:24 2003
From: gregory_r_warnes at groton.pfizer.com (Warnes, Gregory R)
Date: Thu Mar  6 21:07:08 2003
Subject: [Rd] write.table row.names and col.names (PR#2610)
Message-ID: <D7A3CFD7825BD6119B880002A58F06C202F2C692@groexmb02.pfizer.com>


>From ?write.table:

     Normally there is no column name for a column of row names.  If
     `col.names=NA' a blank column name is added.  This can be used to
     write CSV files for input to spreadsheets.

-Greg

> -----Original Message-----
> From: w.huber@dkfz.de [mailto:w.huber@dkfz.de]
> Sent: Thursday, March 06, 2003 12:42 PM
> To: r-devel@stat.math.ethz.ch
> Cc: R-bugs@biostat.ku.dk
> Subject: [Rd] write.table row.names and col.names (PR#2610)
> 
> 
> Full_Name: Wolfgang Huber
> Version: 1.6.2
> OS: DEC OSF, Win, Linux
> Submission from: (NULL) (155.52.45.139)
> 
> 
> When data.frames are written to a file using write.table and 
> with row.names and
> col.names, then the colnames are displaced by 1 with respect 
> to column content.
> Example:
> 
> 
> > x = data.frame(
> >   obscht=c("chriesi", "bire"),
> >     gmues=c("chrut","hoerdoepfl"))
> > rownames(x) = c("huet", "morn")
> > write.table(x, file="test.txt", sep="\t", quote=F)
> 
> The table x now looks like:
> > x
>       obscht      gmues
> huet chriesi      chrut
> morn    bire hoerdoepfl
> 
> but the file is as follows, and the column names will be 
> confused when reading
> this file e.g. from Excel.
> 
> obscht	gmues
> huet	chriesi	chrut
> morn	bire	hoerdoepfl
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
> 


LEGAL NOTICE\ Unless expressly stated otherwise, this message is... [[dropped]]


[Rd] write.table row.names and col.names (PR#2610)
Warnes, Gregory R