rangexy: Report x- and y-range, generic function

View source: R/xyrange.R

rangexyR Documentation

Report x- and y-range, generic function

Description

xyrange returns a list with elements x and y, vectors containing the minimum and maximum of x- and y-values the argument(s). This function serves to determine a plot region.

Usage

rangexy(...)

## Default S3 method:
rangexy(x, y = NULL, finite = TRUE, ...)

Arguments

...

arguments passed to class methods, ignored in default method rangexy.default

x, y

numeric vectors of x- and y- coordinates, or alternatively a single argument x.

finite

logical, indicating if all non-finite elements should be omitted.

Details

The default method passes the arguments x and y to function xy.coords. Therefore, reasonable results can also be expected when e.g. y is NULL and x is a list or data frame with components x and y.

If finite is TRUE, the minimum and maximum of all finite values is computed, and NA and NaN values are ignored.

Value

A list with elements x and y.

Author(s)

Ute Hahn, ute@imf.au.dk

See Also

xy.coords for details on possible values of x when y is NULL

Examples

df <- data.frame(x=1:4, y=(1:4)^2)
rangexy(df)
rangexy(1:4, 5:8)

plutils documentation built on Feb. 19, 2026, 3:01 a.m.