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)

Arguments

area

The original shapefile.

pop

The base population shapefile.

IDlist

The list of all GAT IDs and their corresponding area IDs.

idvar

A variable of unique string values to identify the observations.

nrid

A string that will be the ID for the merged observation (polygon).

Examples


# \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"
  )
# }