% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lexical_analysis.R
\name{calculate_lexical_dispersion}
\alias{calculate_lexical_dispersion}
\title{Calculate Lexical Dispersion}
\usage{
calculate_lexical_dispersion(
  tokens_object,
  terms,
  scale = c("relative", "absolute")
)
}
\arguments{
\item{tokens_object}{A quanteda tokens object}

\item{terms}{Character vector of terms to analyze}

\item{scale}{Character, "relative" (0-1 normalized) or "absolute" (token position)}
}
\value{
Data frame with columns:
\itemize{
\item doc_id: Document identifier
\item term: The search term
\item position: Position in document (relative or absolute)
\item doc_length: Total tokens in document
}
}
\description{
Computes lexical dispersion data for specified terms across a corpus.
Shows where terms appear within each document, useful for understanding
term distribution patterns.
}
\examples{
\donttest{
tokens <- quanteda::tokens(TextAnalysisR::SpecialEduTech$abstract[1:5])
dispersion <- calculate_lexical_dispersion(tokens, c("learning", "instruction"))
}
}
\concept{lexical}
