This function is generic (see Methods); method functions can be written to handle specific classes of data. Classes which already have methods for this function include: dates.
seq(...)seq.default(from=<<see below>>, to=<<see below>>, by=<<see below>>, length=<<see below>>, along=NULL)
from:to # as operator
It is an error to specify all of the first four arguments.
If the difference between from and to is not a multiple of by, then the sequence stops at the last value not past to.
To generate a sequence from 1 to length(x) to parallel an object x, use seq(along=x). This same behavior results from giving seq a single unnamed argument that is not numeric. The expression seq(along=x) produces the desired result even if the length of x is 0 or 1. Except for these two cases, either seq(x) or 1:length(x) will produce the same result.
seq(5) # 1, 2, 3, 4, 5 # the same thing as 1:5 5:1 # 5, 4, 3, 2, 1 seq(-5) # 1, 0, -1, -2, -3, -4, -5 1.1 : 5 # 1.1, 2.1, 3.1, 4.1 seq(0, 1, .01) # 0, .01, .02, .03, ..., 1. seq(-pi, pi, length=100) # 100 values from -pi to pi