Skip to contents

range() computes axis-aligned ranges for Coord1D, Coord2D, and Coord3D class objects.

Usage

# S3 method for class 'Coord1D'
range(..., na.rm = FALSE)

# S3 method for class 'Coord2D'
range(..., na.rm = FALSE)

# S3 method for class 'Coord3D'
range(..., na.rm = FALSE)

Arguments

...

Coord1D, Coord2D, or Coord3D object(s)

na.rm

logical, indicating if NA's should be omitted

Value

Either a Coord1D, Coord2D, or Coord3D object of length two. The first element will have the minimum x/y(/z) coordinates and the second element will have the maximum x/y(/z) coordinates of the axis-aligned ranges.

Examples

range(as_coord2d(rnorm(5), rnorm(5)))
#> <Coord2D[2]>
#>              x          y w
#> [1,] -1.404715 -0.4993554 1
#> [2,]  1.101708  0.9480316 1
range(as_coord3d(rnorm(5), rnorm(5), rnorm(5)))
#> <Coord3D[2]>
#>               x          y          z w
#> [1,] -1.1489039 -1.4372467 -0.7711589 1
#> [2,]  0.8769131  0.8408018  0.8886290 1