weightGATregion: Find the Weighted Centriod for a GAT Region

View source: R/weightGATregion.R

weightGATregionR Documentation

Find the Weighted Centriod for a GAT Region

Description

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.

Usage

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



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"
  )




ajstamm/gatpkg documentation built on Nov. 23, 2023, 9:44 a.m.