View source: R/importGATweights.R
importGATweights | R Documentation |
This function reads in the layer to be aggregated (large area) and the file details for the shapefile containing small areas, including the file name, file location, and variable containing population values.
It subsets the small area layer based on boundaries of the large are layer, then calculates the proportion of each small area that falls in each large area based on the area proportion of the small area that falls in each large area. This creates a base layer from which to create population weighted centroids.
importGATweights(area, filein, pathin, popvar = "Pop_tot")
area |
The spatial polygons data frame you want to aggregate. |
filein |
The filename of the population shapefile. |
pathin |
The path of the population shapefile. |
popvar |
The population variable to use in the population shapefile. |
if (interactive()) {
pathin <- paste0(find.package("gatpkg"), "/extdata")
mywtshp <- importGATweights(area = hftown, filein = "hfblockgrp",
pathin = pathin, popvar = "Pop")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.