range: Python-style range function

Description Usage Arguments See Also Examples

View source: R/range.R

Description

Wrapper around base::seq() that replaces the maximal end value with the supremum and returns an empty vector if b <= a, in the style of Python's range(). Note that peruse::range views end as a supremum, not a maximum, thus range(a,b) is equivalent to the set [a,b) when a < b or {} when b >= a.

Usage

1
range(a, b, ...)

Arguments

a

minimum

b

supremum

...

other params passed to base::seq()

See Also

base::seq()

Examples

1
2
3
range(1,5)
range(9,10)
range(1,6, by = 2)

jacgoldsm/pytools documentation built on March 17, 2021, 6:36 a.m.