R: Get centroids

centroids {terra} | R Documentation

## Get centroids

### Description

Get the centroids for the polygons of a SpatVector

### Usage

    ## S4 method for signature 'SpatVector'
    centroids(x)

### Arguments

`x` | SpatVector

### Value

SpatVector of points

### Examples

    f <- system.file("ex/lux.shp", package="terra")
    v <- vect(f)
    x <- centroids(v)

[Package terra version 1.2-10 Index]