Verify Correct Extensive-Sum Interpolation
aw_verify(source, sourceValue, result, resultValue)
A sf
object with data to be interpolated
A column within source
to be interpolated
A sf
object with interpolated data
A column within result
with the interpolated values
A logical scalar; if TRUE
, these two values are equal.
aw_verify
ensures that the sum of the resulting interpolated
value is equal to the sum of the original source value. This functionality
only works for interpolations that are extensive and use the sum
approach to calculating areal weights.
result <- aw_interpolate(ar_stl_wards, tid = WARD, source = ar_stl_race, sid = GEOID,
weight = "sum", output = "tibble", extensive = "TOTAL_E")
aw_verify(source = ar_stl_race, sourceValue = TOTAL_E, result = result, resultValue = TOTAL_E)
#> [1] TRUE