create_topchart: Plot the top elements for a specific series on the episomer...

View source: R/dataviz.R

create_topchartR Documentation

Plot the top elements for a specific series on the episomer dashboard

Description

Generates a bar plot of most popular elements in posts, for one topic. Top elements among ("topwords", "hashtags", "entities", "contexts", "urls")

Usage

create_topchart(
  sms,
  topic,
  serie,
  country_codes = c(),
  date_min = "1900-01-01",
  date_max = "2100-01-01",
  with_quotes = FALSE,
  top = 25
)

Arguments

sms

Social media

topic

Character(1) containing the topic to use for the report

serie

Character(1) name of the series to be used for the report. It should be one of ("topwords", "hashtags", "entities", "contexts", "urls")

country_codes

Character vector containing the ISO 3166-1 alpha-2 countries to plot, default: c()

date_min

Date indicating start of the reporting period, default: "1900-01-01"

date_max

Date indicating end of the reporting period, default: "2100-01-01"

with_quotes

Logical value indicating whether to include reposts in the time series, default: FALSE

top

numeric(1) Parameter indicating the number of words to show, default: 25

Details

Produces a bar chart showing the occurrences of the most popular words in the collected posts based on the provided parameters.

This functions requires that search_loop and detect_loop have already been run successfully to show results.

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.

See Also

trend_line create_map detect_loop search_loop

Examples

## Not run: 
   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_topchart(
     topic = "dengue",
     serie = "topwords",
     country_codes = c("FR", "CL", "AU"),
     date_min = as.Date(Sys.time())-30,
     date_max=as.Date(Sys.time())
   )
 
## End(Not run)

episomer documentation built on Nov. 26, 2026, 5:07 p.m.