From maechler at stat.math.ethz.ch  Fri Sep  9 11:52:14 2005
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Fri, 9 Sep 2005 11:52:14 +0200
Subject: [Rd] Wishlist: write.delim()
In-Reply-To: <Pine.LNX.4.61.0509081520540.10724@echidna.fhcrc.org>
References: <Pine.LNX.4.61.0509081520540.10724@echidna.fhcrc.org>
Message-ID: <17185.23374.210672.553854@stat.math.ethz.ch>

>>>>> "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



[Rd] Wishlist: write.delim()
Martin Maechler