Compute a resolution in the original map units that conforms to given criteria.
resolution(x, max_ncells = 100)
a Raster* or Spatial* object
Number of cells for the largest dimension
A number. The resolution that respects the desired number of cells.
r <- raster::raster(nrows = 5, ncols = 11, xmn = 0, xmx = 11, ymn = 0, ymx = 5) resolution(r, max_ncells = 10)#>  1.1