Skip to content
Prev 37966 / 63424 Next

History of seq and seq.int

The history is open for all to see. E.g. from the NEWS file (ONEWS in 
pre-2.12.0) entry for R 2.4.0

     o	There is a new primitive seq.int() which is slightly more
 	restricted than seq() but often very much faster, and new
 	primitives seq_along() and seq_len() which are faster still.

It isn't just complex values: seq.default() dispatches on methods for 
e.g. arithmetic so is potentially quite a lot more general.  And if 
you look back, seq() was in R 'for ever' as an interpreted generic 
function -- its peculiarities are taken from blue-book S (although not 
necessarily documented there).

We provide faster versions for use where needed -- but it is rather 
rare that seq() takes up more than a tiny proportion of the run time 
of an R task (and we do provide tools to find out).  Those faster 
versions are used in R's own code where suitable (and as I discovered 
recently, in a couple of places where not).
On Wed, 29 Sep 2010, Radford Neal wrote: