From ggrothendieck at gmail.com  Fri Jul 22 16:06:59 2005
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Fri, 22 Jul 2005 10:06:59 -0400
Subject: [Rd] [R] sequence()
In-Reply-To: <Pine.LNX.4.61.0507221011100.28301@gannet.stats>
References: <7CBD9E72-0812-47A5-8803-34FFDAB37274@soc.soton.ac.uk>
	<Pine.LNX.4.61.0507221011100.28301@gannet.stats>
Message-ID: <971536df05072207061159aa36@mail.gmail.com>

On 7/22/05, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> R-help is not the list for R development questions: you didn't want help
> did you? --> moved to R-devel.
> 
> I do wonder why
> 
> > sequence(c(0,-1))
> [1]  1  0  1  0 -1
> 
> is considered useful.
> 
> Given that the definition seems flawed and I could not find any uses of
> this function in any package my reaction was to suggest the function be
> deprecated on the way to removal.  (I also do not understand why anyone
> would expect sequence() to do that and not one of the many things which
> seq() does.)
> 
> We certainly do not want to replace a function that works as described at
> a reasonable speed by one that does not work as described, however fast.
> 
>        `Accuracy first, speed second'.


I would expand this to 'expected behavior first' where expected is
not with respect to the documentation but with respect to 
normal expectations based on using R, the OS and software,
in general.

Some examples that I think could benefit from this are:

- KalmanLike alters its arguments.  Its been improved in r-devel to
add an option to control this and the option provides compatibliity
with the current KalmanLike and although that seems sensible,
I think the best design here would be to start from scratch again
and have the option default to not modifying its args.  Maybe
a new name should be produced and KalmanLike deprecated.

- write.csv, despite the recent improvement, could benefit from being
a wrapper in the usual way where default args are set.  Its not
terrible the way it is in r-devel but its not the best design either.

- italic does not consistently italicize its arguments.  This is
apparently delibertate but its completely unexpected and would
be best changed.

- *.site and libraries do not get copied from one version of R to
the next when one upgrades R.  I can't think of a well known
product that makes you reconfigure from scratch each time
you upgrade like R does   Its possible to come up with
a configuration that works after upgrade but its not dead
simple like it is with many products.

- R CMD ... does not work on Windows if cmd instead of CMD 
is used.  This is quite unexpected if you are a Windows user
where commands are normally case insensitive.  

These are only the examples I can think of off the top of my 
head since they were topics of recent discussions.



[Rd] [R] sequence()
Gabor Grothendieck