Combine scales into a product index

scale_product(..., name = "", desc = "", keys = NULL, joint_weights = NULL)

Arguments

...

Two or more named NestedScale objects; the argument names become the axis names.

name, desc

Short name and description of the product.

keys

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.

joint_weights

Reserved; see ScaleProduct.

Value

A ScaleProduct.

Examples

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
#>