View source: R/alert_functions.R
fouralert | R Documentation |
Yellow is raised when environmental conditions required for positive mosquito population growth are detected, green otherwise.Orange indicates evidence of sustained transmission, red indicates evidence of an epidemic scenario.
fouralert(obj, crit, miss = "last", dy = 4)
obj |
dataset with data to feed the alert, containing the variables specified in crit. |
crit |
criteria for the alert colors. See setCriteria() |
miss |
how missing data is treated. "last" if last value is repeated. It is currently the only option |
dy |
if inc > 0, and rt was orange or red at least once in the past dy weeks -> level yellow. Default: dy=4 |
returns an object of class "alerta" containing four elements: the data, the alert indices, and the rules used to define the indices.
# Parameters of the alert model
val = c(varcli ="temp_min", "clicrit"="22","limiar_preseason"="10","limiar_epidemico"="100")
criteria = setCriteria(rule="Af",values=val)
# Get, organize data
cas = getCases(cities = 3200300, cid10 = "A90") %>%
Rt(count = "casos",gtdist="normal", meangt=3, sdgt = 1) %>%
mutate(inc = casos/pop*100000)
cli = getWU(stations = 'SBGL', vars="temp_min") %>%
mutate(temp_min = nafill(temp_min, rule = "arima"))
tw = getTweet(cities = 3200300)
# Calculate alert
ale <- plyr::join_all(list(cas,cli,tw), by="SE")
resf <- fouralert(ale, crit = criteria)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.