powered by
range()
This function returns c(NA, NA) instead of c(-Inf, Inf) for zero-length data without any warnings.
c(NA, NA)
c(-Inf, Inf)
range_noinf(x, na.rm = FALSE, finite = FALSE)
A 2-element vector of class numeric.
numeric
(numeric) a sequence of numbers for which the range is computed.
(flag) flag indicating if NA should be omitted.
flag
NA
(flag) flag indicating if non-finite elements should be removed.
x <- rnorm(20, 1) range_noinf(x, na.rm = TRUE) range_noinf(rep(NA, 20), na.rm = TRUE) range(rep(NA, 20), na.rm = TRUE)
Run the code above in your browser using DataLab