get_alerts | R Documentation |
generate_alerts
of detect_loop
Returns a data frame of signals produced by the detect_loop
, which are stored on the signal folder.
get_alerts(
topic = character(),
countries = numeric(),
from = "1900-01-01",
until = "2100-01-01",
toptweets = 0,
limit = 0,
duplicates = "all",
progress = function(a, b) { }
)
topic |
Character vector. When it is not empty it will limit the returned signals to the provided topics, default: character() |
countries |
Character vector containing the names of countries or regions or a numeric vector containing the indexes of countries as displayed at the Shiny App to filter the signals to return., default: numeric() |
from |
Date defining the beginning of the period of signals to return, default: '1900-01-01' |
until |
Date defining the end of the period of signals to return, default: '2100-01-01' |
toptweets |
Integer number of top tweets to be added to the alert. These are obtained from the tweet index based on topwords and Lucene score, default: 0 |
limit |
Maximum number of alerts returned, default: 0 |
duplicates |
Character, action to decide what to do with alerts generated on the same day. Options are "all" (keep all alerts), "first" get only first alert and "last" for getting only the last alert |
progress |
Function, function to report progress it should receive two parameter a progress between 0 and 1 and a message, default: empty function |
For more details see the package vignette.
a data frame containing the calculated alerts for the period. If no alerts are found then NULL is returned
generate_alerts
detect_loop
if(FALSE){
library(epitweetr)
# setting up the data folder
message('Please choose the epitweetr data directory')
setup_config(file.choose())
# Getting signals produced for last 30 days for a particular country
get_alerts(
countries = c("Chile", "Australia", "France"),
from = as.Date(Sys.time())-30,
until = as.Date(Sys.time())
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.