[Rd] [R] sequence()

Gabor Grothendieck ggrothendieck at gmail.com
Fri Jul 22 16:06:59 CEST 2005

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.

More information about the R-devel mailing list