myseq: Safe sequence operator

Description Usage Arguments Details Value

View source: R/utils.R

Description

This is a safer version of base::seq(). In particular, it avoids creating backwards sequences, unless the by parameter is explicitly negative.

Usage

1
2
3
myseq(from, to, by = 1)

from %:% to

Arguments

from

Start of sequence.

to

End of sequence.

by

Step size. Can be negative, and then to must not be more than from.

Details

%:% is the operator version of myseq.

Value

An integer vector.


r-lib/ansistrings documentation built on March 7, 2020, 10:13 p.m.