Regularly spaced grids containing continuous data are transformed into contour polygons. A grid can be defined by a data.frame (x, y, value), an sf object or a terra SpatRaster.
sf
terra