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.
units(x, by)A TMA model object with unit labels and empty context slots for each unit.
A data.frame or TMA model object containing the raw input data.
Character vector of column names to use for defining units of analysis (e.g., c("userID", "condition")).