Calculate the range (min, max) for each coordinate axis.
Value
If
xis a single matrix: returns a 2x2 matrix (rows: min/max, cols: x/y)If
xis a list: returns a list of 2x2 matricesIf
xis a tibble: returns a list of 2x2 matrices extracted from coo column
Details
Returns a matrix where row 1 is min values and row 2 is max values for x and y.
This is not a scalar, so cannot be used with measure().
Examples
get_range(shapes$cat)
#> [,1] [,2]
#> [1,] 130 9
#> [2,] 249 231
get_range(shapes)
#> $cat
#> [,1] [,2]
#> [1,] 130 9
#> [2,] 249 231
#>
#> $dog
#> [,1] [,2]
#> [1,] 104 45
#> [2,] 316 227
#>
#> $heart
#> [,1] [,2]
#> [1,] 99 34
#> [2,] 306 213
#>
#> $leaf2
#> [,1] [,2]
#> [1,] 109 20
#> [2,] 282 226
#>
