Learn R Programming

textAnnotatoR (version 1.0.1)

generate_code_co_occurrence_analysis: Generate code co-occurrence statistics and visualization

Description

Performs a comprehensive analysis of code co-occurrences in the text, including calculation of various similarity metrics and generation of network and heatmap visualizations.

Usage

generate_code_co_occurrence_analysis(
  annotations,
  text = NULL,
  unit = "paragraph"
)

Value

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

Arguments

annotations

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

text

Character string containing the original text (optional)

unit

Character string specifying the analytical unit: "sentence", "paragraph", or "document"