range_i: Range (Actually Minimum and Maximum) of Integer Values

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

Written in C++, this function should always run faster than range for integer vectors/matrices. Not valid for non-integer objects.

Usage

1

Arguments

x

Integer vector or matrix.

Value

Integer vector.

Examples

1
2
3
4
# In general, range_i is much faster than range
x <- rpois(1000, lambda = 5) 
all.equal(range(x), range_i(x))
benchmark(range(x), range_i(x), replications = 10000)

dvmisc documentation built on May 2, 2019, 5:51 p.m.

Related to range_i in dvmisc...