safeseq: A "safer" seq

Description Usage Arguments Value Author(s) See Also Examples

View source: R/varComp-utilities.R

Description

This is the same as seq(from, to, by) except that when the sign of by is wrong, safeseq returns a zero-length vector rather than throwing an error.

Usage

1
safeseq(from = 1L, to = 1L, by = 1L, ...)

Arguments

from

The same as the from in base::seq.

to

The same as the to in base::seq.

by

The same as the by in base::seq.

...

The same as in base::seq.

Value

A vector of the same class as by*(from-to), but possibly with length being zero.

Author(s)

Long Qu

See Also

base::seq

Examples

1
identical(integer(0L), safeseq(1L, 0L, 1L))

varComp documentation built on May 2, 2019, 5:15 p.m.