get_alerts {epitweetr} | R Documentation |
Getting signals produced by the task generate_alerts
of detect_loop
Description
Returns a data frame of signals produced by the detect_loop
, which are stored on the signal folder.
Usage
get_alerts(
topic = character(),
countries = numeric(),
from = "1900-01-01",
until = "2100-01-01",
toptweets = 0,
limit = 0,
duplicates = "all",
progress = function(a, b) { }
)
Arguments
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 |
Details
For more details see the package vignette.
Value
a data frame containing the calculated alerts for the period. If no alerts are found then NULL is returned
See Also
Examples
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())
)
}