aggregate_and_document_scale function

Aggregate variables and remember which variables this were