# ranges: Sample range In iemisc: Irucka Embry's Miscellaneous Functions

## Description

This function computes the sample range.

## Usage

 `1` ```ranges(x, na.rm = FALSE, finite = FALSE) ```

## Arguments

 `x` numeric vector `na.rm` logical vector that determines whether the missing values should be removed or not. `finite` logical vector that determines whether non-finite values should be removed or not.

## Details

"The range is the difference between the largest number and the smallest number in the set." Source: Onwubiko page 176.

The following statements are from `range`:

"If na.rm is `FALSE`, `NA` and `NaN` values in any of the arguments will cause `NA` values to be returned, otherwise `NA` values are ignored."

"If finite is `TRUE`, the minimum and maximum of all finite values is computed, i.e., `finite = TRUE` includes `na.rm = TRUE`."

## Value

ranges as the difference between the maximum and minimum values in `x` as a numeric `vector`. Unlike the `range`, ranges can't take character vectors as arguments, only numeric vectors.

## References

Chinyere Onwubiko, An Introduction to Engineering, Mission, Kansas: Schroff Development Corporation, 1997, page 176.

`sgm` for geometric mean, `shm` for harmonic mean, `cv` for coefficient of variation (CV), `rms` for root-mean-square (RMS), `relerror` for relative error, and `approxerror` for approximate error.
 ```1 2 3 4 5``` ```library("iemisc") require(stats) set.seed(100) # makes the example reproducible x <- rnorm(100) ranges(x) ```