% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lexical_analysis.R
\name{plot_entity_frequencies}
\alias{plot_entity_frequencies}
\title{Plot Named Entity Frequencies}
\usage{
plot_entity_frequencies(
  entity_data,
  top_n = 20,
  title = "Named Entity Type Frequency",
  color = NULL,
  height = 500,
  width = NULL,
  custom_colors = NULL
)
}
\arguments{
\item{entity_data}{Data frame containing entity data with columns:
\itemize{
\item \code{entity}: Named entity type (e.g., "PERSON", "ORG", "GPE")
\item \code{n}: (optional) Pre-computed frequency count
}
If \code{n} is not present, frequencies will be computed from the data.}

\item{top_n}{Number of top entity types to display (default: 20)}

\item{title}{Plot title (default: "Named Entity Type Frequency")}

\item{color}{Bar color (default: "#10B981")}

\item{height}{Plot height in pixels (default: 500)}

\item{width}{Plot width in pixels (default: NULL for auto)}

\item{custom_colors}{Named vector of custom entity type colors (e.g.,
c(CONCEPT = "#00acc1", THEME = "#7c4dff")). Custom colors override defaults.}
}
\value{
A plotly object
}
\description{
Creates a bar plot showing the frequency distribution of named entity types.
}
\examples{
if (interactive()) {
  entity_df <- data.frame(
    entity = c("PERSON", "ORG", "GPE", "DATE", "MONEY"),
    n = c(300, 250, 200, 150, 100)
  )
  plot_entity_frequencies(entity_df)

  # With custom colors
  plot_entity_frequencies(entity_df, custom_colors = c(PERSON = "#ff0000"))
}
}
\concept{visualization}
