The default method for
sequence generates the sequence
seq(from[i], by = by[i], length.out = nvec[i]) for each
i in the parallel (and recycled) vectors
nvec. It then returns the result of concatenating
sequence(nvec, ...) ## Default S3 method: sequence(nvec, from = 1L, by = 1L, ...)
coerced to a non-negative integer vector each element of which specifies the length of a sequence.
coerced to an integer vector each element of which specifies the first element of a sequence.
coerced to an integer vector each element of which specifies the step size between elements of a sequence.
additional arguments passed to methods.
Negative values are supported for
sequence(nvec, from, by=0L) is equivalent to
This function was originally implemented in R with fewer features, but it has since become more flexible, and the default method is implemented in C for speed.
Of the current version, Michael Lawrence based on code from the S4Vectors Bioconductor package
sequence(c(3, 2)) # the concatenated sequences 1:3 and 1:2. #>  1 2 3 1 2 sequence(c(3, 2), from=2L) #>  2 3 4 2 3 sequence(c(3, 2), from=2L, by=2L) #>  2 4 6 2 4 sequence(c(3, 2), by=c(-1L, 1L)) #>  1 0 -1 1 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.