Learn R Programming

tma (version 0.3.1)

units: Set Units of Analysis for a TMA Model

Description

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)

Value

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

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")).