Extract centroids from the polygons within a shapefile.

extract_centroids(shapefile)

Arguments

shapefile

SpatialPolygonsDataFrame containing polygons

Value

list containing centroids as SpatialPoints and a dataframe with basic data on each polygon (e.g. name)

Examples

if (FALSE) {
sF_download(year = 2016)
electorate_centroids_2016 <- extract_centroids(sF_16)
}