TRUE when every unit of frame holds the same number of atoms, or the same total of a weight column: the dimension-free form of a "regular" calendar (equal durations) or an equal-area regionalisation. Atoms with no code at frame are ignored.

scale_is_uniform(x, frame, weight = NULL, tolerance = 1e-09)

Arguments

x

A NestedScale.

frame

A frame name.

weight

NULL compares atom counts; a weight column name compares its per-unit totals.

tolerance

Relative tolerance for weight totals.

Value

A logical scalar. When FALSE, the attribute "sizes" holds the per-unit counts or totals.

Examples

s <- scale_example()
scale_is_uniform(s, "class")                  # two atoms each
#> [1] TRUE
scale_is_uniform(s, "class", weight = "size") # but not the same size
#> [1] FALSE
#> attr(,"sizes")
#>   G1   G2   S1 
#>  300  700 1100