Re: [Rd] write.table confused by rownames/colnames (PR#7941)

From: <rasche_at_molgen.mpg.de>
Date: Wed 15 Jun 2005 - 13:11:07 GMT


Hello,

Alright, I did not look at it that way I admit. I built a matrix with multiple row names (as a data.frame). Confusion started when exporting this as a spread-sheet.
Now it all works fine.

Thanks and sorry for the false alarm,
Axel

Prof Brian Ripley wrote:
> It seems that you are the one who is confused: the help file says
>
> By default there is no column name for a column of row names. If
> 'col.names = NA' a blank column name is added.
>
> If there are no row names, there is no point in adding a blank column
> name for them. So what did *you* think it would do?
>
> On Wed, 15 Jun 2005 rasche@molgen.mpg.de wrote:
>

>> Full_Name: Axel Rasche
>> Version: 2.1.0
>> OS: Win2000
>> Submission from: (NULL) (141.14.21.81)
>>
>>
>> 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)
>> 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)

>
>
>
-- 
*******************************************
Dipl. Math. ETH Axel Rasche
Max-Planck-Institute for Molecular Genetics
Department Lehrach (Vertebrate Genomics)
Ihnestrasse 63-73
D-14195 Berlin-Dahlem
GERMANY

Tel. ++49-30-8413-1289
Fax  ++49-30-8413-1380

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Jun 15 23:14:10 2005

This archive was generated by hypermail 2.1.8 : Mon 24 Oct 2005 - 22:27:19 GMT