Each rule defines behaviour in both directions. Direction is taken from the frame ranks, so aggregation and disaggregation are one operation:
SCALE_RULESA character vector of length 7.
sumUp: sum. Down: split proportionally to the weight. For extensive quantities (capacity, demand, area, population).
weighted_meanUp: weight-weighted mean. Down: copy unchanged. For intensive quantities (efficiency, price, capacity factor).
meanUp: unweighted mean. Down: copy unchanged.
copyUp: the common value, erroring if it is not constant. Down: copy unchanged. For scale-invariant scalars.
sdUp: standard deviation over the atoms (aggregation only;
going down it degenerates to NA for single-atom groups).
shareShare within parent: each source unit's value divided by
the total over its parent group. Unlike every other rule the result
stays keyed at the source frame – the recast target (or
parent=) names the parent – so it cannot be mixed with other rules
in one call (the two share rules mix freely, being one computation).
For building distribution keys and normalised profiles; requires
from to nest within the parent.
logshareThe same computation as share – the values ARE
shares – but figures draw it on a fixed log10 percent scale
(0.01%..100%), where share gets a fixed linear 0..1 scale.
SCALE_RULES
#> [1] "sum" "weighted_mean" "mean" "copy"
#> [5] "sd" "share" "logshare"