[Rd] minor (possibly documentation) bug in seq

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Feb 5 09:01:13 MET 2004


On Wed, 4 Feb 2004, Deepayan Sarkar wrote:

> 
> With today's r-devel, help(seq) says:
> 
>      The last generates the sequence '1, 2', ..., 'length(along)',
>      unless the argument is of length 1 when it is interpreted as a
>      'length' argument.
> 
> referring to the usage 
> 
>      seq(along)
> 
> This is not true for 0:
> 
> > seq(0)
> [1] 1 0
> > seq(length = 0)
> numeric(0)
> 
> I'm not sure what the intended behaviour of seq(0) is, but either seq()
> or the help page should be fixed.

Nor am I, but it seems S documents the behaviour as 1:from, so I guess 
that is intended.

> Also, the exception (naturally) holds only for _numeric_ arguments of length 
> 1. 

I've altered the help page.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list