Data query
As tabelas geradas pelo Infodengue contem dados agregados por semana provenientes de diferentes fontes. Elas podem ser consultadas via formulário, ou diretamente do R, por meio de uma consulta à API.
Infodengue’s tables have data aggregated by week, provided by different sources. They could be consulted by a form, or directly from R, via consult of an API.
This functionality is available via the URL: https://info.dengue.mat.br/api/alertcity?params: must contain the following parameters:
geocode: city's IBGE code
disease: desease type to be consulted (str:dengue|chikungunya|zika)
format: file extension/format (str:json|csv)
ew_start: epidemiological week initial consultation (int:1-53)
ew_end: epidemiological week final consultation (int:1-53)
ey_start: year of initial consultation (int:0-9999)
ey_end: year of final consultation (int:0-9999)
Every parameter mentioned so far is obligatory for the consultation. The following example shows the requisition of the register of dengue between 1 and 52 of the year 2020, in Rio de Janeiro (geocodigo = 3304557) on CSV: :
https://info.dengue.mat.br/api/alertcity?geocode=3304557&disease=dengue&format=csv&ew_start=1&ew_end=52&ey_start=2020&ey_end=2020
How to do it using R?
1. Define the parameters
Verify if the consult is correct:
url <- "https://info.dengue.mat.br/api/alertcity?"
geocode <- 3304557
disease <- "dengue"
format <- "csv"
ew_start <- 1
ew_end <- 52
ey_start <- 2021
ey_end <- 2021
# do not change
cons1 <- paste0(url,"geocode=",geocode,"&disease=",disease,"&format=",format,"&ew_start=",ew_start,"&ew_end=",ew_end,"&ey_start=",ey_start,"&ey_end=",ey_end)
cons1
[1] "https://info.dengue.mat.br/api/alertcity?geocode=3304557&disease=dengue&format=csv&ew_start=1&ew_end=52&ey_start=2021&ey_end=2021"
2. Consulting:
dados <- read_csv(cons1, show_col_types=FALSE) %>% arrange(data_iniSE)
glimpse(dados)
Rows: 40
Columns: 21
$ data_iniSE <date> 2021-01-03, 2021-01-10, 2021-01-17, 2021-01-24, 2021-01-31, 202…
$ SE <dbl> 202101, 202102, 202103, 202104, 202105, 202106, 202107, 202108, …
$ casos_est <dbl> 9, 11, 14, 30, 18, 17, 17, 25, 23, 32, 36, 43, 47, 74, 64, 41, 4…
$ casos_est_min <dbl> 9, 11, 14, 30, 18, 17, 17, 25, 23, 32, 36, 43, 47, 74, 64, 41, 4…
$ casos_est_max <dbl> 9, 11, 14, 30, 18, 17, 17, 25, 23, 32, 36, 43, 47, 74, 64, 41, 4…
$ casos <dbl> 9, 11, 14, 30, 18, 17, 17, 25, 23, 32, 36, 43, 47, 74, 64, 41, 4…
$ p_rt1 <dbl> 0.64216300, 0.73637200, 0.82569900, 0.99771600, 0.56761300, 0.24…
$ p_inc100k <dbl> 0.133377, 0.163016, 0.207475, 0.444588, 0.266753, 0.251933, 0.25…
$ Localidade_id <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ nivel <dbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1…
$ id <dbl> 3.304557e+17, 3.304557e+17, 3.304557e+17, 3.304557e+17, 3.304557…
$ versao_modelo <date> 2021-10-13, 2021-10-13, 2021-10-13, 2021-10-13, 2021-10-13, 202…
$ Rt <dbl> 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1…
$ pop <dbl> 6747815, 6747815, 6747815, 6747815, 6747815, 6747815, 6747815, 6…
$ tempmin <dbl> 24, 24, 24, 25, 24, 22, 24, 23, 24, 23, 24, 24, 23, 21, 20, 20, …
$ umidmax <dbl> 90, 89, 84, 80, 85, 90, 95, 95, 90, 96, 93, 91, 93, 94, 92, 92, …
$ receptivo <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0…
$ transmissao <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ nivel_inc <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
$ notif_accum_year <dbl> 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032…
The data table
The available variables are:
- data_iniSE: First day of the epidemiological week (Sunday);
- SE: epidemiological week;
- casos_est: Estimated number of cases per week using the nowcasting model (note: Values are updated retrospectively every week);
- casos_est_min e casos_est_max: 95% credibility interval of the estimated number of cases;
- casos: Number of reported cases per week (Values are updated retrospectively every week);
- p_rt1: Probability of (Rt> 1). For issuing the orange alert, we use criterion p_rt1 > 0.95 for 3 weeks or more;
- p_inc100k: Estimated incidence rate per 100,000;
- Localidade_id: Sub-municipality division (currently implemented only in Rio de Janeiro);
- nivel: Alert level (1 = green, 2 = yellow, 3 = orange, 4 = red);
- id: Numerical index;
- versao_modelo: Model version (internal use);
- Rt: Point estimate of the reproductive number of cases, see (Know more);
- pop: estimated population (IBGE);
- tempmin: average of the daily minimum temperatures along the week;
- umidmax: average of the daily maximum relative air humidity along the week;
- receptivo: indicates climate receptivity, i.e., conditions for high vectorial capacity. 0 = - - unfavorable, 1 = favorable, 2 = favorable this week and last week, 3 = favorable for at least - three weeks (sufficient for completing a transmission cycle);
- transmissao: evidence of sustained transmission: 0 = no evidence, 1 = possible, 2 = likely, 3 = highly likely;
- nivel_inc: Estimated incidence below the pre-epidemic threshold, 1 = above the pre-epidemic threshold, but below the epidemic threshold, 2 = above the epidemic threshold;
- notif_accum_year: accumulated number of cases per year;
3. Plotting examples
suppressPackageStartupMessages(library(ggTimeSeries))
library(ggplot2)
#Weekly count of reported cases of dengue in the city of Rio de Janeiro. Arrows indicate weekly variation.
p1 <- ggplot_waterfall(dados,'SE','casos', nArrowSize = 0.8)
p1 + scale_fill_manual(
values = c("forestgreen", "blue", "darkred"),
labels = c("4wd", "front", " rear")) +
xlab("Epidemiological Week")+
ylab("Reported Cases")+
scale_x_continuous(breaks=dados$SE)+
theme_light() +
theme(legend.position="none",axis.text.x = element_text(angle = 45,size=23, hjust = 1),
axis.text.y = element_text(size=23),axis.title= element_text(size=30))
suppressPackageStartupMessages(library(plotly))
#Reported cases and estimated cases
p2 <- plot_ly(dados,x = ~as.factor(SE))
p2 <- p2 %>% add_bars(y = ~casos, type = 'bar',
name = "Reported cases",
text = "Reported cases",
marker = list(color = 'lightblue'),
hovertemplate = paste("Date:",dados$data_iniSE,"<br>",
"%{xaxis.title.text}: %{x}<br>",
"%{text}: %{y}<br>"))%>%
add_lines(y = ~casos_est, name = "Estimated cases",text = "Estimated cases",line =list(dash = "linear", color="blue"),
hovertemplate = paste("Date:",dados$data_iniSE,"<br>",
"%{xaxis.title.text}: %{x}<br>",
"%{text}: %{y}<br>")) %>%
add_lines(y = ~casos_est_min, name = "Minimum Interval of the estimated cases",text = "Minimum Interval of the estimated cases", line=list(dash = "dot", color="black"),
hovertemplate = paste("Date:",dados$data_iniSE,"<br>",
"%{xaxis.title.text}: %{x}<br>",
"%{text}: %{y}<br>")) %>%
add_lines(y = ~casos_est_max,name = "Maximum Interval of the estimated cases",text = "Maximum Interval of the estimated cases", line =list(dash ="dot", color="black"),
hovertemplate = paste("Date:",dados$data_iniSE,"<br>",
"%{xaxis.title.text}: %{x}<br>",
"%{text}: %{y}<br>")) %>%
layout(title = list(text = "Total reported and estimated cases for Rio de Janeiro", x = 0),
xaxis = list(title = "Epidemiological Week",
tick0=202101, dtick=1,tickangle=315,tickfont = list( size=12)),
yaxis = list(title = "Number of cases"))
p2 %>% layout(legend = list(orientation="h", x = 0.5, y = 1,
legend.background = element_rect(fill = "transparent")))
LS0tCnRpdGxlOiAiSW5mb2Rlbmd1ZSIKYXV0aG9yOiAiW2luZm8uZGVuZ3VlLm1hdC5icl0oaHR0cDovL2luZm8uZGVuZ3VlLm1hdC5icikiIApvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKLS0tCgpgYGB7ciBpbmNsdWRlID0gRkFMU0V9IAprbml0cjo6b3B0c19jaHVuayRzZXQobWVzc2FnZSAgPSBGQUxTRSAsIHdhcm5pbmc9RkFMU0UpCmBgYAoKClRoaXMgW1IgTWFya2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cGxhdGUgPSBwYXN0ZSgiRGF0ZToiLGRhZG9zJGRhdGFfaW5pU0UsIjxicj4iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXt4YXhpcy50aXRsZS50ZXh0fTogJXt4fTxicj4iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXt0ZXh0fTogJXt5fTxicj4iKSkgJT4lCiAgICAgICAgICAgICBhZGRfbGluZXMoeSA9IH5jYXNvc19lc3RfbWluLCBuYW1lID0gIk1pbmltdW0gSW50ZXJ2YWwgb2YgdGhlIGVzdGltYXRlZCBjYXNlcyIsdGV4dCA9ICJNaW5pbXVtIEludGVydmFsIG9mIHRoZSBlc3RpbWF0ZWQgY2FzZXMiLCBsaW5lPWxpc3QoZGFzaCA9ICJkb3QiLCBjb2xvcj0iYmxhY2siKSwKICAgICAgICAgICAgICAgICAgICAgICBob3ZlcnRlbXBsYXRlID0gcGFzdGUoIkRhdGU6IixkYWRvcyRkYXRhX2luaVNFLCI8YnI+IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiV7eGF4aXMudGl0bGUudGV4dH06ICV7eH08YnI+IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiV7dGV4dH06ICV7eX08YnI+IikpICU+JQogICAgICAgICAgICAgYWRkX2xpbmVzKHkgPSB+Y2Fzb3NfZXN0X21heCxuYW1lID0gIk1heGltdW0gSW50ZXJ2YWwgb2YgdGhlIGVzdGltYXRlZCBjYXNlcyIsdGV4dCA9ICJNYXhpbXVtIEludGVydmFsIG9mIHRoZSBlc3RpbWF0ZWQgY2FzZXMiLCBsaW5lID1saXN0KGRhc2ggPSJkb3QiLCBjb2xvcj0iYmxhY2siKSwKICAgICAgICAgICAgICAgICAgICAgICBob3ZlcnRlbXBsYXRlID0gcGFzdGUoIkRhdGU6IixkYWRvcyRkYXRhX2luaVNFLCI8YnI+IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiV7eGF4aXMudGl0bGUudGV4dH06ICV7eH08YnI+IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiV7dGV4dH06ICV7eX08YnI+IikpICU+JQogICAgICAgICAgICBsYXlvdXQodGl0bGUgPSBsaXN0KHRleHQgPSAiVG90YWwgcmVwb3J0ZWQgYW5kIGVzdGltYXRlZCBjYXNlcyBmb3IgUmlvIGRlIEphbmVpcm8iLCB4ID0gMCksCiAgICAgICAgICAgICAgICAgICB4YXhpcyA9IGxpc3QodGl0bGUgPSAiRXBpZGVtaW9sb2dpY2FsIFdlZWsiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpY2swPTIwMjEwMSwgZHRpY2s9MSx0aWNrYW5nbGU9MzE1LHRpY2tmb250ID0gbGlzdCggc2l6ZT0xMikpLAogICAgICAgICAgICAgICAgICAgeWF4aXMgPSBsaXN0KHRpdGxlID0gIk51bWJlciBvZiBjYXNlcyIpKQoKcDIgJT4lIGxheW91dChsZWdlbmQgPSBsaXN0KG9yaWVudGF0aW9uPSJoIiwgeCA9IDAuNSwgeSA9IDEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWdlbmQuYmFja2dyb3VuZCA9IGVsZW1lbnRfcmVjdChmaWxsID0gInRyYW5zcGFyZW50IikpKQpgYGAKCgoK