fouralert: Define conditions to issue a four level alert...

Description Usage Arguments Value Examples

View source: R/alert_functions.R

Description

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.

Usage

1
fouralert(obj, crit, miss = "last", dy = 4)

Arguments

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

Value

returns an object of class "alerta" containing four elements: the data, the alert indices, and the rules used to define the indices.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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)

claudia-codeco/AlertTools documentation built on Aug. 12, 2021, 9:58 a.m.