View source: R/get_timeseries.R
getCases | R Documentation |
Create weekly time series from case data from server. The source is the SINAN.
getCases(
cities,
lastday = Sys.Date(),
firstday = as.Date("2018-01-01"),
cid10 = "A90",
dataini = "notific",
completetail = NA,
type = "notified",
datasource = con
)
cities |
cities' geocode. |
lastday |
last day. Default is the last available. Format: "yyyy-mm-dd" |
firstday |
is the first date of the time series to be produced. 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. |
type |
case definition. Default = "notified". Other options: "probable", "lab_confirmed", "all". All means returning the three counts. |
datasource |
PostgreSQLConnection to project database. |
returndata |
TRUE if returns individual data as well. |
data.frame with the data aggregated per week according to disease onset date. Notice that the names of the columns and the number of columns will change according to type. To recover the original function behavior, use the default type.
NOT USE: con <- dbConnect(RSQLite::SQLite(), "../../AlertaDengueAnalise/mydengue.sqlite")
d <- getCases(cities = 3106200, dataini = "sinpri", type = "all") # 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 = 3304557, firstday = as.Date("2023-01-01"),dataini = "sinpri")
tail(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.