aw_weight {areal} | R Documentation |
Calculate Areal Weight
Description
aw_weight
creates an area weight field by dividing the area
field by the total area field. This is the third step in the interpolation
process after aw_weight.
Usage
aw_weight(.data, areaVar, totalVar, areaWeight)
Arguments
.data |
A |
areaVar |
The name of the variable measuring a feature's area |
totalVar |
The name of the variable containing total area field by |
areaWeight |
The name of a new area weight field to be calculated |
Value
A sf
object with the intersected data and new area weight field.
Examples
library(dplyr)
race <- select(ar_stl_race, GEOID, TOTAL_E)
wards <- select(ar_stl_wards, WARD)
wards %>%
aw_intersect(source = race, areaVar = "area") %>%
aw_total(source = race, id = GEOID, areaVar = "area", totalVar = "totalArea",
weight = "sum", type = "extensive") -> intersect
aw_weight(intersect, areaVar = "area", totalVar = "totalArea", areaWeight = "areaWeight")
[Package areal version 0.1.8 Index]