grange: Guarded range

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Convenience function. Finds the range of a numerical component with a name common to a list of objects, omitting any missing values. xrange() and yrange() are front-ends for the cases component = "x" and component = "y" respectively.

Usage

1
2
3
4
5
grange(..., component)

xrange(...)

yrange(...)

Arguments

...

Objects, all of which have a numerical component with the same name

component

Character string specifying the name of the component in common

Value

A 2-component numerical vector specifying a common range

Examples

1
2
3
4
d <- density(~log(crim), MASS::Boston)
h <- density_histogram(~log(crim), MASS::Boston)
plot(d, xlim = xrange(h,d), ylim = yrange(h,d))
lines(h)

BillVenables/WWRGraphics documentation built on Feb. 1, 2021, 12:13 p.m.