Whole grain buffers.

snap_extent(x, res)

buffer_extent(x, res)

Arguments

x

extent (xmin, xmax, ymin, ymax)

res

resolution (a grain to align to)

Value

extent, snapped to the resolution

Examples

snap_extent(sort(rnorm(4)), 0.01)
#> [1] -1.31  0.37  0.73  1.89