powered by
Helper function. Ratio is computed as width/height (or cols/rows).
asp_ratio(x)
The aspect ratio.
A SpatRaster object, an sf/sfc object or a numeric vector of length 4 with coordinates c(xmin, ymin, xmax, ymax), as created by sf::st_bbox().
SpatRaster
sf/sfc
xmin
ymin
xmax
ymax
sf::st_bbox()
# \donttest{ library(terra) x <- rast(system.file("tiff/elev.tiff", package = "rasterpic")) plot(x) asp_ratio(x) # }
Run the code above in your browser using DataLab