A residual carries a real value but is not a destination for allocation:
non-regionalized GDP, taxes that belong to no industry, an "n.e.c." bucket.
It aggregates upward like any other unit – that is the point, it is what
makes the parent total reconcile – but recast_scale() never splits a
coarse figure INTO one.
scale_residuals(x, frame = NULL)A NestedScale.
A single frame name for just that frame's residuals, or
NULL for the whole named list.
A character vector of unit codes, or the named list over frames. Empty when the scale declares none.
Declare them when building the scale, per frame, because codes are not
unique across frames:
scale_from_leaftable(..., residuals = list(unit = "DE_XR")).
s <- scale_example()
scale_residuals(s) # none declared
#> list()
lf <- scale_leaftable(s)
r <- scale_from_leaftable(
lf,
frames = scale_frames(s), key = "unit",
weights = scale_weights(s), name = "with_residual",
residuals = list(unit = "OTH")
)
scale_residuals(r, "unit")
#> [1] "OTH"