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.

geo_lim(lower = double(), upper = double())

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

# S3 method for default
geo_range(x, na.rm = FALSE, finite = FALSE)

# S3 method for 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

geo_lim(3, 4)
#> <geovctrs_lim[1]> #> [1] [3, 4]
# works like range() but returns a geo_lim() geo_range(1:100)
#> <geovctrs_lim[1]> #> [1] [1, 100]
# you can also pass geo_lim() vectors to geo_range() geo_range(c(geo_lim(81, Inf), geo_lim(-100, 12)))
#> <geovctrs_lim[1]> #> [1] [-100, Inf]