Combine scales into a product index
scale_product(..., name = "", desc = "", keys = NULL, joint_weights = NULL)Two or more named NestedScale objects; the argument names become
the axis names.
Short name and description of the product.
Optional named character vector overriding the data key column
per axis. By default each axis uses its scale's own key
(scale_key()); if that would make two axes share a column name, the
AXIS NAMES are used instead.
Reserved; see ScaleProduct.
A ScaleProduct.
p <- scale_product(a = scale_example(), b = scale_example2())
p
#> ScaleProduct: <unnamed>
#> Axes (2):
#> a : NestedScale 'example' sector/class/group/unit atoms 7 key: unit
#> b : NestedScale 'example2' era/period atoms 4 key: period
#> Atoms: 7 x 4 = 28 (not materialised)
product_size(p)
#> $axes
#> a b
#> 7 4
#>
#> $total
#> [1] 28
#>