getCases: Get Case Data and aggregate per week and area

Description Usage Arguments Value Examples

View source: R/get_timeseries.R

Description

Create weekly time series from case data from server. The source is the SINAN.

Usage

1
2
3
4
5
6
7
8
getCases(
  cities,
  lastday = Sys.Date(),
  cid10 = "A90",
  dataini = "notific",
  completetail = NA,
  datasource = con
)

Arguments

cities

cities' geocode.

lastday

last day. Default is the last available. Format: "yyyy-mm-dd"

cid10

cid 10 code. Dengue = "A90" (default), Chik = "A92.0", Zika = "A92.8",

dataini

"notific" if data aggregated by notification date or "sinpri" if data aggregated if aggregated by date of first symptoms

completetail

if sinan data is older than final_day, fill in the tail with NA (default) or 0.

datasource

PostgreSQLConnection to project database.

Value

data.frame with the data aggregated per week according to disease onset date.

Examples

1
2
3
4
5
6
7
NOT USE: con <- dbConnect(RSQLite::SQLite(), "../../AlertaDengueAnalise/mydengue.sqlite")
d <- getCases(cities = 4314902, dataini = "sinpri") # dengue
d <- getCases(cities = 3300936, completetail = 0) # dengue
d <- getCases(cities = 3304557, cid10="A92.0") # chikungunya, until last day available
cid <- getCidades(regional = "Norte",uf = "Rio de Janeiro")
d <- getCases(cities = cid$municipio_geocodigo, datasource = con, dataini = "sinpri") 
tail(d)

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