sevendigitgeocode: Returns the most recent date present in the database table.

View source: R/utility_tools.R

sevendigitgeocodeR Documentation

Returns the most recent date present in the database table.

Description

Useful to check if the database is up-to-date.

calculates the verification digit of brazilian municipalities. Required to convert 6 digits to 7 digits geocodes.

Usage

sevendigitgeocode(dig)

Arguments

tab

table in the database. Either (sinan, clima_wu, tweet, historico, historico_mrj).

cities

vector of geocodes.

cid10

relevant for sinan, tweeter or historico. Codes are: dengue "A90", chik "A92.0", zika "A92.8".

stations

vector with wu stations. Ex. c("SGBL", "SBRL")

datasource

Value

vector with two elements: data.max = most recent date in the collection of cities or stations; se = corresponding epidemiological week.

7 digits municipality geocode.

Examples

cidades <- getCidades(regional = "Sete Lagoas", uf = "Minas Gerais")
lastDBdate(tab = "tweet", cities = cidades$municipio_geocodigo, cid10 = "A90")
lastDBdate(tab = "sinan", cities = cidades$municipio_geocodigo, cid10 = "A92.8")
lastDBdate(tab = "clima_wu", stations = "SBAF", datasource=con)  
lastDBdate(tab = "clima_wu", cities = cidades$municipio_geocodigo, datasource=con)  
sevendigitgeocode(330455)
sevendigitgeocode(3304557)
sevendigitgeocode(261153)

AlertaDengue/AlertTools documentation built on Nov. 27, 2024, 11:55 p.m.