Generate a regular sequence based on the range of a vector

seqRg(x, n, offset = 0, prop = TRUE)

seqCol(df)

seqRow(df)

Arguments

x

a vector.

n

the number of values in the output sequence.

offset

extend or reduce the range .

prop

a logical. If TRUE, then offset is a proportion of the range, otherwise offset is used as is.

df

a data frame or a matrix.

Functions

  • seqCol: a regular sequence based on the number of columns in a data frame.

  • seqRow: a regular sequence based on the number of rows in a data frame.

Examples

seqRg(runif(10), 10)
#> [1] 0.1644105 0.2444884 0.3245662 0.4046441 0.4847219 0.5647998 0.6448776 #> [8] 0.7249555 0.8050333 0.8851111
seqRg(1:10, 10, .5)
#> [1] -3.5 -1.5 0.5 2.5 4.5 6.5 8.5 10.5 12.5 14.5
seqCol(matrix(1, 3, 2))
#> [1] 1 2