Helper function. Ratio is computed as width/height (or col/rows).
Arguments
- x
- A - SpatRasterobject, an- sf/sfcobject or a numeric vector of length 4 with coordinates c(- xmin,- ymin,- xmax,- ymax), as created by- sf::st_bbox().
Examples
# \donttest{
library(terra)
#> terra 1.8.70
x <- rast(system.file("tiff/elev.tiff", package = "rasterpic"))
plot(x)
 asp_ratio(x)
#> [1] 2.34375
# }
asp_ratio(x)
#> [1] 2.34375
# }
