[Rd] Wishlist: write.delim()

Martin Maechler maechler at stat.math.ethz.ch
Fri Sep 9 11:52:14 CEST 2005


>>>>> "Douglas" == Douglas Grove <dgrove at fhcrc.org>
>>>>>     on Thu, 8 Sep 2005 15:33:02 -0700 (PDT) writes:

    Douglas> Hi,
    Douglas> It would be great if someone would add write.delim() as an
    Douglas> adjunct to write.table(), just as with write.csv().

    Douglas> I store a lot of data in tab-delimited files and can read
    Douglas> it in easily with:  read.delim("text.txt", as.is=TRUE)
    Douglas> and would love to be able to write it out as easily when
    Douglas> I create these files.

    Douglas> The obvious setting needed for write.delim() is sep = "\t",
    Douglas> but in addition I would request the setting row.names = FALSE

    Douglas> i.e. 

    Douglas> write.delim(x, file) = write.table(x, file, sep = "\t", row.names=FALSE)

i.e.,
   write.delim <- function(x, file, ...) 
		    write.table(x, file, sep = "\t", row.names=FALSE, ...)

So, why don't you just add that one line to your .Rprofile ?

In general, I don't think that it's worth to introduce a whole
new function just because of some frequent argument use of an
already existing function  {{and I have wondered if it was worth
to provide write.csv() at all - although, there the difference to default
write.table() is quite a bit larger}}

Martin



More information about the R-devel mailing list