geo_lim: Vectorized one-dimensional limits

Description Usage Arguments Value Examples

View source: R/geo-lim.R

Description

Vectorized version of range() to support geo_x_range(), geo_y_range(), and geo_z_range(). The geo_range() function works like range(), but also works with geo_lim() vectors.

Usage

1
2
3
4
5
6
7
8
9
geo_lim(lower = double(), upper = double())

geo_range(x, na.rm = FALSE, finite = FALSE)

## Default S3 method:
geo_range(x, na.rm = FALSE, finite = FALSE)

## S3 method for class 'geovctrs_lim'
geo_range(x, na.rm = FALSE, finite = FALSE)

Arguments

lower, upper

The lower and upper bounds of the one-dimensional rage.

x

A vector of numbers or geo_lim()s.

na.rm

Should NAs be removed?

finite

Should only finite values be considered? TRUE implies na.rm = TRUE.

Value

A new_geovctrs_lim().

Examples

1
2
3
4
5
6
7
geo_lim(3, 4)

# works like range() but returns a geo_lim()
geo_range(1:100)

# you can also pass geo_lim() vectors to geo_range()
geo_range(c(geo_lim(81, Inf), geo_lim(-100, 12)))

paleolimbot/geovctrs documentation built on July 30, 2020, 3:41 p.m.