min_n: Minimum of Numeric Values

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

Written in C++, this function tends to run faster than min for large numeric vectors/matrices.

Usage

1
min_n(x)

Arguments

x

Numeric vector.

Value

Numeric value.

Examples

1
2
3
4
5
6
7
8
9
# For large objects, min_n is faster than min
x <- rnorm(100000)
min(x) == min_n(x)
benchmark(min(x), min_n(x), replications = 1000)

# For smaller objects, min_n is slower than min
x <- rnorm(100)
min(x) == min_n(x)
benchmark(min(x), min_n(x), replications = 20000)

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