Learn R Programming

berryFunctions (version 1.4)

seqR: Add a range argument to seq

Description

sequence given by range or vector of values.

Usage

seqR(from=1, to=1, range, ...)

Arguments

from
start value of sequence. DEFAULT:1
to
end value of sequence. DEFAULT:1
range
vector with 2 values (1st taken as from, 2nd as to) or more (the result is then always ascending).
...
further arguments passed to seq.

Value

  • Numeric vector.

See Also

seq, range, http://r.789695.n4.nabble.com/seq-range-argument-td4684627.html

Examples

Run this code
seqR(range=c(12,6), by=-2)

m <- c(41, 12, 38, 29, 50, 39, 22)
seqR(range=extendrange(m, f=0.1), len=5)
# Takes min and max of range if the vector has more than two elements.

seqR(range=m, by=3)

Run the code above in your browser using DataLab