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

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Wed 15 Jun 2005 - 12:54:15 GMT

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)

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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

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