Learn R Programming

rasterpic (version 0.3.1)

asp_ratio: Compute aspect ratio of an object

Description

Helper function. Ratio is computed as width/height (or cols/rows).

Usage

asp_ratio(x)

Value

The aspect ratio.

Arguments

x

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().

Examples

Run this code
# \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