This function identifies the population weighted centroids for all areas in your original map.
weightGATmap(area, pop, idvar, popvar, crs = NULL)
Spatial layer representing areas to be aggregated.
Spatial layer containing underlying population values.
Variable of unique string values to identify the layer's observations.
The base population variable.
User-defined non-lat/long projection, entered as a string. For the default, NULL, the function defines the projection.
if (interactive()) {
cen <- weightGATmap(area = hftown, pop = hfpop, idvar = "ID", popvar = "Pop")
}