% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/semantic_analysis.R
\name{plot_sentiment_by_category}
\alias{plot_sentiment_by_category}
\title{Plot Sentiment by Category}
\usage{
plot_sentiment_by_category(
  sentiment_data,
  category_var,
  plot_type = "bar",
  title = NULL
)
}
\arguments{
\item{sentiment_data}{Data frame with 'sentiment' column}

\item{category_var}{Name of the category variable column}

\item{plot_type}{Type of plot: "bar" or "stacked" (default: "bar")}

\item{title}{Plot title (default: auto-generated)}
}
\value{
A ggplot2 grouped/stacked bar chart
}
\description{
Creates a grouped or stacked bar plot showing sentiment distribution across categories.
}
\examples{
\donttest{
articles <- TextAnalysisR::SpecialEduTech[1:20, ]
sentiment_results <- analyze_sentiment(articles$abstract)
sentiment_data <- cbind(
  reference_type = articles$reference_type,
  sentiment_results
)
sentiment_plot <- plot_sentiment_by_category(sentiment_data, "reference_type")
print(sentiment_plot)
}
}
\concept{sentiment}
