# range

##### Range of Values

`range`

returns a vector containing the minimum and maximum of
all the given arguments.

##### Usage

`range(…, na.rm = FALSE)`# S3 method for default
range(…, na.rm = FALSE, finite = FALSE)

##### Arguments

##### Details

`range`

is a generic function: methods can be defined for it
directly or via the `Summary`

group generic.
For this to work properly, the arguments `…`

should be
unnamed, and dispatch is on the first argument.

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`

.

A special situation occurs when there is no (after omission
of `NA`

s) nonempty argument left, see `min`

.

##### S4 methods

This is part of the S4 `Summary`

group generic. Methods for it must use the signature
`x, …, na.rm`

.

##### References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
*The New S Language*.
Wadsworth & Brooks/Cole.

##### See Also

The `extendrange()`

utility in package grDevices.

##### Examples

`library(base)`

```
# NOT RUN {
(r.x <- range(stats::rnorm(100)))
diff(r.x) # the SAMPLE range
x <- c(NA, 1:3, -1:1/0); x
range(x)
range(x, na.rm = TRUE)
range(x, finite = TRUE)
# }
```

*Documentation reproduced from package base, version 3.6.1, License: Part of R 3.6.1*