R/create_centroids.R
create_centroids.RdCreate a data frame of longitude and latitude centroids of each polygon.
create_centroids(shp_sf, sf_id, largest = TRUE, verbose = FALSE)an sf object, a data set with a simple feature list column
a string to indicate the column to identify individual polygons
logical; for st_centroid: if TRUE, return centroid of the
largest subpolygon of a MULTIPOLYGON rather than the whole MULTIPOLYGON
a boolean to indicate whether to show function progress
a tibble containing longitude and latitude
centroids <- create_centroids(tas_lga, "lga_code_2016")