From ggrothendieck at gmail.com  Thu Jul  7 18:38:30 2005
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Thu, 7 Jul 2005 12:38:30 -0400
Subject: [Rd] write.csv (PR#7992)
In-Reply-To: <20050707162756.E6D97A49F@slim.kubism.ku.dk>
References: <20050707162756.E6D97A49F@slim.kubism.ku.dk>
Message-ID: <971536df05070709387b3f64d6@mail.gmail.com>

This may not be inconsistent with the documentation but it is 
inconsistent with good practice.  Wrappers should, in general,
set the default values, as the poster rightly indicated, and not the 
values themselves.  Its not a coincidence that multiple people 
have mentioned this.

On 7/7/05, maechler at stat.math.ethz.ch <maechler at stat.math.ethz.ch> wrote:
> This topic already came up about a week ago on R-devel
>  Subject: write.csv suggestion
> 
>  [ too bad that "R-devel" is not available via  RSiteSearch() ...
>    {I could send you the back archives, Jon, if you are interested} ]
> 
> There, Brian Ripley, explained why this is not a bug, since
> it works as documented, "CSV" files are well defined entities
> and you can always use write.table() if you want to be flexible.
> 
> Brian also changed things for R-devel {to be R 2.2.x} such that
> its help page, see
>   http://stat.ethz.ch/R-manual/R-devel/library/base/html/write.table.html ,
> now  has
> 
> > Usage:
> >        . . . .
> >
> >      write.csv(...)
> >      write.csv2(...)
> >
> > . . . .
> >
> >
> > Arguments:
> >        . . . .
> >
> >      ...: arguments to 'write.table': 'col.names', 'sep', 'dec' and
> >           'qmethod' cannot be altered.
> 
> which should make the intention of the write.csv*() wrapper
> functions a bit more clear.
> 
> Regards,
> Martin Maechler, ETH Zurich
> 
> >>>>> "arnima" == arnima  <arnima at u.washington.edu>
> >>>>>     on Thu,  7 Jul 2005 05:21:43 +0200 (CEST) writes:
> 
>    arnima> The write.csv() function is currently implemented as
>    arnima> function (..., col.names=NA, sep=",", qmethod="double")
>    arnima> {
>    arnima> write.table(..., col.names=NA, sep=",", qmethod="double")
>    arnima> }
> 
>    arnima> Surely, it should be
> 
>    arnima> function (..., col.names=NA, sep=",", qmethod="double")
>    arnima> {
>    arnima> write.table(..., col.names=col.names, sep=sep, qmethod=qmethod)
>    arnima> }
> 
>    arnima> so that the user arguments serve a purpose. This notion is reflected in
>    arnima> the implementation of read.csv(), for example, where sep=sep, quote=quote,
>    arnima> etc.
> 
> 
>    arnima> Arni
> 
>    arnima> R 2.1.1pat 2005-07-04 on WinXP
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] write.csv (PR#7992)
Gabor Grothendieck