Replace the geometry of a polygon with its centroid point
Source:R/spat_polygon_centroid.R
Polygon_Centroid.RdThis function replaces the geometry of a simple feature (sf) polygon object
with the geometry of its centroid point. It can optionally rename the
geometry column of the modified sf object.
Value
The modified sf object with its geometry replaced by the centroid of
the original polygon geometry. If rename is TRUE, the geometry column
will also be renamed as specified by NewName.