aw_calculate {areal} | R Documentation |
aw_calculate
multiplies the given value
by the area weight. This
is the fourth step in the interpolation process after aw_weight.
aw_calculate(.data, value, areaWeight, newVar)
.data |
A given intersected dataset |
value |
A column within |
areaWeight |
The name of the variable containing area weight per feature |
newVar |
Optional; a new field name to store the interpolated value in. If not specified,
the |
An intersected file of class sf with a new field of interest recalculated with area weight
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") %>% aw_weight(areaVar = "area", totalVar = "totalArea", areaWeight = "areaWeight") -> intersect aw_calculate(intersect, value = "TOTAL_E", areaWeight = "areaWeight")