[R] seq curiosity

Martyn Plummer plummer at iarc.fr
Fri May 3 10:26:45 CEST 2002


On 03-May-2002 John Aitchison wrote:

> Is this a bug or a feature?
> 
>> seq(0:4)  # colon 
> [1] 1 2 3 4 5
>> 0:4
> [1] 0 1 2 3 4
>> seq(0,4)
> [1] 0 1 2 3 4
> 
> I am aware that the first usage is incorrect, but I was surprised that
> I did not get any sort of syntax error

Feature.  With a single (vector) argument, seq returns the sequence
1:n where n is the length of the vector.  This is described on the
help page ( see argument "along" ).

Martyn
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list