range_noinf: Re-implemented 'range()' default S3 method for numerical...

View source: R/utils.R

range_noinfR Documentation

Re-implemented range() default S3 method for numerical objects

Description

This function returns c(NA, NA) instead of c(-Inf, Inf) for zero-length data without any warnings.

Usage

range_noinf(x, na.rm = FALSE, finite = FALSE)

Arguments

x

(numeric)
a sequence of numbers for which the range is computed.

na.rm

(flag)
flag indicating if NA should be omitted.

finite

(flag)
flag indicating if non-finite elements should be removed.

Value

A 2-element vector of class numeric.


tern documentation built on Sept. 24, 2024, 9:06 a.m.