Find conversations by unit
tma.conversations.RdIdentify 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.
Usage
tma.conversations(
x,
units,
units.by = NULL,
codes = NULL,
conversation.by = NULL,
window = 4,
conversation.exclude = c(),
id_col = "QEUNIT"
)Arguments
- x
A data.frame or context model containing conversation data.
- units
Character vector of unit identifiers to extract conversations for.
- units.by
Character vector of column names specifying unit grouping (default: from context model attributes).
- codes
Character vector of code columns to use for identifying coded rows.
- conversation.by
Character vector of column names to group by conversation.
- window
Integer; window size for co-occurrence (default: 4).
- conversation.exclude
Character vector of conversation keys to exclude.
- id_col
Character; column name for unit IDs (default: "QEUNIT").
Value
A list with elements:
- conversations
List of row indices for each conversation.
- unitConvs
Unique conversation keys for the specified units.
- allRows
All row indices included for the units.
- unitRows
Row indices for the units with codes.
- convRows
All row indices for the unit's conversations.
- toRemove
Rows not meeting co-occurrence criteria.