Helper function. The ratio is computed as width / height (or cols / rows).
Arguments
- x
A
SpatRasterobject, ansf/sfcobject or a numeric vector of length 4 with coordinatesc(xmin, ymin, xmax, ymax), as created bysf::st_bbox().
Examples
# \donttest{
library(terra)
#> terra 1.9.27
x <- rast(system.file("tiff/elev.tiff", package = "rasterpic"))
plot(x)
asp_ratio(x)
#> [1] 2.34375
# }
