From ligges at statistik.uni-dortmund.de  Wed Jun 15 14:52:44 2005
From: ligges at statistik.uni-dortmund.de (ligges@statistik.uni-dortmund.de)
Date: Wed, 15 Jun 2005 14:52:44 +0200 (CEST)
Subject: [Rd] write.table confused by rownames/colnames (PR#7941)
Message-ID: <20050615125244.86455EC75@slim.kubism.ku.dk>

rasche at molgen.mpg.de wrote:

> Full_Name: Axel Rasche
> Version: 2.1.0
> OS: Win2000
> Submission from: (NULL) (141.14.21.81)
> 
> 
> Hi,
> 
> write.table does not accept the second statement with
>     <col.names = NA, row.names = FALSE>.
> I do not see why this should not be possible.
> 
> test = matrix(1:4, 2, 2, dimnames = list( c("a","b"), c("c","d") ))
> write.table(test, file = "test.txt", sep = "\t", quote = FALSE,
> 	col.names = NA, row.names = FALSE)

 From my point of view one should not expect NA to work, but the help 
page says a "logical" is allowed and gives a correpsonding "NA" example, 
hence it is a bug, either in the help page or in the code.
I'd vote for changing the help and depreciating NA for 
col.names/row.names, because I do not know what NA is expected to do and 
therefore I could not provide any bugfix for the code ...

Uwe Ligges




> write.table(test, file = "test.txt", sep = "\t", quote = FALSE, 
> 	col.names = NA)
> write.table(test, file = "test.txt", sep = "\t", quote = FALSE, 
> 	col.names = TRUE, row.names = FALSE)
> write.table(test, file = "test.txt", sep = "\t", quote = FALSE, 
> 	col.names = FALSE, row.names = FALSE)
> 
> Thanks,
> Axel
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] write.table confused by rownames/colnames (PR#7941)
ligges@statistik.uni-dortmund.de