% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dataviz.R
\name{create_topwords}
\alias{create_topwords}
\title{Plot the top words report on the episomer dashboard}
\usage{
create_topwords(
  sms,
  topic,
  country_codes = c(),
  date_min = "1900-01-01",
  date_max = "2100-01-01",
  with_quotes = FALSE,
  top = 25
)
}
\arguments{
\item{sms}{Social media}

\item{topic}{Character(1) containing the topic to use for the report}

\item{country_codes}{Character vector containing the ISO 3166-1 alpha-2 countries to plot, default: c()}

\item{date_min}{Date indicating start of the reporting period, default: "1900-01-01"}

\item{date_max}{Date indicating end of the reporting period, default: "2100-01-01"}

\item{with_quotes}{Logical value indicating whether to include reposts in the time series, default: FALSE}

\item{top}{numeric(1) Parameter indicating the number of words to show, default: 25}
}
\value{
A named list containing two elements: 'chart' with the ggplot2 figure and 'data' containing the data frame that was used to build the map.
}
\description{
Generates a bar plot of most popular words in posts, for one topic
}
\details{
Produces a bar chart showing the occurrences of the most popular words in the collected posts based on the provided parameters.

This report may be empty for combinations of countries and topics with very few posts since for performance reasons, the calculation of top words is an approximation using chunks of 10.000 posts.

This function requires that \code{\link{search_loop}} and \code{\link{detect_loop}} have already been run successfully to show results.
}
\examples{
\dontrun{
   message('Please choose the episomer data directory')
   setup_config(file.choose())
   #Getting topword chart for dengue for France, Chile, Australia for last 30 days
   create_topwords(
     topic = "dengue",
     country_codes = c("FR", "CL", "AU"),
     date_min = as.Date(Sys.time())-30,
     date_max=as.Date(Sys.time())
   )
 }
}
\seealso{
\code{\link{trend_line}}
 \code{\link{create_map}}
 \code{\link{detect_loop}}
 \code{\link{search_loop}}
}
