range {peruse}R Documentation

Python-style range function

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

range(a, b, ...)

Arguments

a

minimum

b

supremum

...

other params passed to base::seq()

See Also

base::seq()

Examples

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

[Package peruse version 0.3.1 Index]