powered by
Calculates the diagonal length of a raster's extent, accounting for the coordinate reference system.
diagonal(x)
The diagonal distance in meteres.
A raster object.
library(terra) # Read data from the mrangr package K_map <- rast(system.file("input_maps/K_map_eg.tif", package = "mrangr")) diagonal(K_map)
Run the code above in your browser using DataLab