Range of Data

DESCRIPTION:
Returns the minimum and the maximum of all of the elements of all of the arguments.

USAGE:
range(..., na.rm=F)

REQUIRED ARGUMENTS:
...:
numeric objects. Missing values (NAs) are allowed.

OPTIONAL ARGUMENTS:
na.rm=:
logical flag: should missing values be removed before computation? This argument must be specified in the na.rm= form.

VALUE:
vector of two elements, the first is the minimum of all the elements of all the arguments; the second is the maximum. Any NAs in the input result in NAs in the output unless na.rm=TRUE.

DETAILS:
This is part of the Summary group of generic functions - see Methods.

This function is useful as an argument to plotting when it is desired to specify the limits for the x- or y-axes. (See the plot example.)


SEE ALSO:
quantile , max , pmax , sort .

EXAMPLES:
plot(x, y, ylim=range(y, 0, 1)) # force y-axis to include (0, 1)

diff(range(x)) # distance between max and min