Scales

Build a scale and read its structure.

scale_from_leaftable()

Build a NestedScale from a flat table of atoms

scale_example()

A small example NestedScale

scale_example2()

A second small example NestedScale

NestedScale()

NestedScale (S7 class)

scale_class() scale_product_class()

The scale classes, for subclassing and dispatch

scale_is() scale_is_product()

Is this a scale, or a product of scales?

scale_frames() names(<NestedScale>)

Frames of a NestedScale

scale_units()

Units of a NestedScale

scale_key()

The atom key column name

scale_leaftable() as.data.frame(<NestedScale>) as.data.frame(<nestedscales::NestedScale>)

The leaftable of a NestedScale

scale_weights()

Weight columns of a NestedScale

scale_rank()

Frame rank

scale_atom_level()

The level at which a scale enumerates its atoms

scale_residuals()

Units that are residuals

is_valid_frame()

Validate frame names

summary(<NestedScale>) summary(<nestedscales::NestedScale>) print(<summary_Scale>)

Summarize a NestedScale

`[`(<NestedScale>) `[`(<nestedscales::NestedScale>)

Subset a NestedScale

Move between frames and report what a unit holds.

scale_children() scale_parents() scale_descendants() scale_ancestors()

Navigate a NestedScale's hierarchy

scale_family()

Immediate parent-child table between two frames

scale_ancestry()

Ancestry between all frame pairs

scale_nests()

Do two frames nest?

scale_crosses()

Do two frames form a product?

scale_is_uniform()

Are the units of a frame the same size?

scale_share()

Weight shares within a frame

scale_coverage()

Coverage of a sampled NestedScale

Subsetting

filter_scale()

Subset a NestedScale by unit

prune_scale()

Collapse a NestedScale to a coarser frame

Conversion

Recast data between resolutions, attach labels, and declare rules.

recast_scale()

Recast values from one resolution to another

recast()

Recast data through a scale

recast_to_atoms() recast_from_atoms()

Recast unit data down to the atom layer, and back

recast_crosswalk()

Recast values through a given crosswalk

join_scale()

Attach scale labels and memberships to a dataset

reconcile_scale()

Check fine data against an independent parent total

SCALE_RULES

Supported aggregation rules

register_scale_rule()

Register how a parameter should be recast

get_scale_rule()

Look up a registered rule

list_scale_rules()

List registered rules

clear_scale_rules()

Clear the rule registry

Crosswalks

The map behind every conversion, and the registry of exact ones.

scale_map()

Crosswalk between two frames of a scale

scale_map_between()

Crosswalk between two scales through their shared atoms

register_scale_map() register_scale_map_between() get_scale_map() get_scale_map_between() list_scale_maps()

Register / look up a direct crosswalk

clear_scale_maps()

Clear the registered crosswalks

Products of scales

Several scales as one multi-index.

scale_product()

Combine scales into a product index

ScaleProduct()

A product of several scales (S7 class)

scale_axes()

Axes of a product

product_size()

Size of a product

product_keys()

The data key column of each axis

product_frames()

Frames of each axis

product_weights()

Weight columns of each axis

product_coverage()

Coverage of each axis

product_atoms()

Realise the atoms of a product

recast_product()

Recast data indexed by a product of scales

join_product()

Attach every axis's labels to product-indexed data

filter_product()

Subset a product componentwise

summary(<ScaleProduct>) summary(<nestedscales::ScaleProduct>) print(<summary_ScaleProduct>)

Summarize a product

Clustering

Group units by their data into a new, coarser frame.

cluster_scale()

Cluster the units of a scale into a new frame

cluster_contiguous()

Cluster the units of a scale under a contiguity constraint

cluster_medoids()

The representative unit of each cluster

cluster_sweep()

Cluster quality across a range of k

scale_distance()

Distance between the units of a scale

SCALE_DISTANCES

Built-in distances

register_scale_distance() get_scale_distance() list_scale_distances() clear_scale_distances()

Register a distance

Arrays and storage

as_scale_array() as_scale_table()

Data on scales as a dense array

write_scale_dataset()

Write data and the scales that index it to one folder

open_scale_dataset() print(<scale_dataset>)

Open a scale-aware dataset

scale_dataset_info()

Describe a stored dataset without opening it fully

Building a dimension package

Hooks and helpers for packages that subclass NestedScale.

scale_alias_property()

An alias property for a subclass

scale_vocab()

The dimension vocabulary of a scale

scale_payload_slice()

Subset a subclass's per-atom payload

scale_atom_pairs()

Atom-level correspondence between two frames

Package

nestedscales nestedscales-package

nestedscales: Nested Scales and Multi-Dimensional Indexes for Modeling