analyze_coding_density: Analyze coding density in text

View source: R/annotate_gui.R

analyze_coding_densityR Documentation

Analyze coding density in text

Description

Calculates metrics related to coding density in the text, including overall density and identification of densely coded regions.

Usage

analyze_coding_density(annotations)

Arguments

annotations

Data frame containing annotations with columns:

  • start: numeric, starting position

  • end: numeric, ending position

  • code: character, code identifier

Details

Density is calculated as the ratio of coded text to total text length. Dense regions are identified where consecutive annotations are close together (within 20 characters by default).

Value

List containing:

  • overall_density: Numeric value representing proportion of text covered by codes

  • dense_regions: List of vectors, each containing start and end positions of identified dense coding regions


textAnnotatoR documentation built on April 3, 2025, 7:35 p.m.