View source: R/weightGATregion.R
weightGATregion | R Documentation |
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)
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). |
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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.