Skip to contents

Internal helper to initialize and label units of analysis in a TMA model object. Given a data.frame and a set of columns, this function creates a model structure with unit labels and context placeholders for each unique unit.

Usage

units(x, by)

Arguments

x

A data.frame or TMA model object containing the raw input data.

by

Character vector of column names to use for defining units of analysis (e.g., c("userID", "condition")).

Value

A TMA model object with unit labels and empty context slots for each unit.