Skip to contents

For each row, accumulates co-occurrences over a backward stanza window. Preserves directionality: the output columns are the n_codes x n_codes adjacency matrix in column-major order, ground codes as rows and response codes as columns, so 0-based column (j*n_codes + i) represents code i (context/ground) co-occurring with code j (current row/response). Returns a matrix with n_codes² columns (full square adjacency).

Usage

accum_stanza_window(df, windowSize = 1, binary = TRUE)

Arguments

df

A data frame of code columns (one row per utterance)

windowSize

Number of prior rows in the window (default 1; use Inf for all prior rows in the stanza)

binary

Logical; binarise non-zero co-occurrences (default TRUE)

Value

Numeric matrix with nrow(df) rows and ncol(df)² columns

Details

Delegates to accumulate_stanza(ordered = TRUE).