| generate_alerts | R Documentation |
Evaluate alerts for the last collected day for all topics and regions and send email alerts to subscribers
generate_alerts(tasks = get_tasks())
tasks |
Current tasks for reporting purposes, default: get_tasks() |
This function calculates alerts for the last aggregated day and then sends emails to subscribers.
The alert calculation is based on the country_counts time series which stores alerts by country, hour and topics.
For each country and region, the process starts by aggregating the last N days. A day is defined as a block of consecutive 24 hours ending before the hour of the last collected post. N is defined by the alert baseline parameter on the configuration tab of the Shiny application (the default is N=7).
An alert will be produced when the number of posts observed is above the threshold calculated by the modified version of the EARS algorithm (for more details see the package vignette). The behaviour of the alert detection algorithm is modified by the signal false positive rate (alpha), by downweighting previous alerts and by weekly or daily baseline parameters, as defined in the configuration tab of the Shiny application and the topics file.
A prerequisite for this function is that the search_loop must already have stored posts in the search folder and that the geotagging and aggregation tasks have been completed.
Normally, this function is not called directly by the user, but from the detect_loop function.
The list of tasks updated with produced messages
detect_loop
## Not run:
library(episomer)
# setting up the data folder
message('Please choose the episomer data directory')
setup_config(file.choose())
# calculating alerts for last day posts and sending emails to subscribers
generate_alerts()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.