Identify and extract rows corresponding to conversations for specified units in a dataset or context model. Useful for subsetting and analyzing conversational windows in network analysis.
tma.conversations(
x,
units,
units.by = NULL,
codes = NULL,
conversation.by = NULL,
window = 4,
conversation.exclude = c(),
id_col = "QEUNIT"
)A list with elements:
List of row indices for each conversation.
Unique conversation keys for the specified units.
All row indices included for the units.
Row indices for the units with codes.
All row indices for the unit's conversations.
Rows not meeting co-occurrence criteria.
A data.frame or context model containing conversation data.
Character vector of unit identifiers to extract conversations for.
Character vector of column names specifying unit grouping (default: from context model attributes).
Character vector of code columns to use for identifying coded rows.
Character vector of column names to group by conversation.
Integer; window size for co-occurrence (default: 4).
Character vector of conversation keys to exclude.
Character; column name for unit IDs (default: "QEUNIT").
This function groups rows by conversation (using `conversation.by` columns), identifies which rows are associated with the specified units and codes, and returns indices for each conversation, as well as metadata about which rows to include or exclude.