This function identifies the population weighted centroid of a new area based on the GAT ID assigned to the old areas and the population shapefile.
weightGATregion(area, pop, IDlist, idvar, nrid)
The original shapefile.
The base population shapefile.
The list of all GAT IDs and their corresponding area IDs.
A variable of unique string values to identify the observations.
A string that will be the ID for the merged observation (polygon).
# \donttest{
ids <- c("e", "e", "d", "d", "f", "f", "f", "e", "e", "d", "e",
"d", "b", "c", "c", "a", "b", "c", "a", "b", "c")
mycentroid <-
weightGATregion(
area = hftown,
pop = hfpop,
IDlist = ids,
idvar = "ID",
nrid = "c"
)
# }