Performs a comprehensive analysis of code co-occurrences in the text, including calculation of various similarity metrics and generation of network and heatmap visualizations.
generate_code_co_occurrence_analysis(
annotations,
text = NULL,
unit = "paragraph"
)List containing:
co_occurrence: Matrix of raw co-occurrence counts
jaccard_similarity: Matrix of Jaccard similarity coefficients
phi_coefficient: Matrix of Phi coefficients
network_plot: Network visualization of code relationships
heatmap_plot: Heatmap visualization of code co-occurrences
summary: List of summary statistics
Data frame containing text annotations with columns:
start: numeric, starting position of annotation
end: numeric, ending position of annotation
code: character, code applied to the annotation
Character string containing the original text (optional)
Character string specifying the analytical unit: "sentence", "paragraph", or "document"