| adicionar_territorio | R Documentation |
Validates a territorial code column and appends the corresponding current IBGE names and hierarchy. Six-digit DATASUS municipality codes are converted to seven-digit IBGE codes. The function does not redistribute historical observations across boundary changes.
adicionar_territorio(
dados,
codigo,
nivel = c("municipio", "uf", "regiao"),
desconhecido = c("erro", "na"),
sobrescrever = FALSE
)
dados |
A data frame. |
codigo |
Name of the territorial code column. |
nivel |
Territorial level: '"municipio"', '"uf"' or '"regiao"'. |
desconhecido |
How to handle unknown values: '"erro"', '"na"' or '"manter"'. |
sobrescrever |
Whether existing columns with catalog names may be replaced. |
'dados' with territorial columns appended.
dados <- data.frame(codmun = c("500270", "500370"), casos = c(10, 5))
adicionar_territorio(dados, "codmun")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.