Records the rule (and optionally the weight) to use for a named value
column, so callers of recast_scale() need not repeat it. Downstream
packages register their own parameter maps at load time.
register_scale_rule(param, rule, weight = NULL, scope = NULL)Name of the value column.
One of SCALE_RULES.
Optional weight column name used by sum (down) and
weighted_mean (up). NULL means the scale's default weight.
Optional dimension namespace (e.g. "calendar",
"geoscale"). NULL registers the rule for every dimension.
Invisibly, the registered entry.
register_scale_rule("capacity", "sum")
register_scale_rule("eff", "weighted_mean", weight = "count")
get_scale_rule("eff")
#> $rule
#> [1] "weighted_mean"
#>
#> $weight
#> [1] "count"
#>
#> $scope
#> NULL
#>
clear_scale_rules(c("capacity", "eff"))