A reprojected raster rarely has round cells: a nominally 10m grid comes out
as 9.99673 x 10.00151. That precision matters in the data and reads as
noise on a screen, so round it for display.
Arguments
- res
Either the numeric pair
terra::res()returns, or the"9.99673x10.00151"string carried in aconnectivityobject'sdata_resolutioncolumn.- digits
Decimal places to round to. Default 1.
Examples
format_resolution(c(9.99673, 10.00151))
#> [1] "10 x 10"
format_resolution("9.99673x10.00151")
#> [1] "10 x 10"