Skip to content

Commit

Permalink
Merge branch 'master' into sinan-chikungunya
Browse files Browse the repository at this point in the history
  • Loading branch information
rfsaldanha authored Sep 13, 2021
2 parents 4fa3810 + 13e67af commit 80c1721
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ README.md
^LICENSE\.md$
^data-raw$
^\.github$
^cran-comments\.md$
^CRAN-RELEASE$
2 changes: 2 additions & 0 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This package was submitted to CRAN on 2021-09-09.
Once it is accepted, delete this file and tag the release (commit c874b63).
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export(process_cnes)
export(process_sia)
export(process_sih)
export(process_sim)
export(process_sinan_dengue)
export(process_sinasc)
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# microdatasus 1.2.0
* Download and preprocess SINAN Chikungunya files.

# microdatasus 1.1.4
* Minor correctiont at process_sinan_dengue function.

# microdatasus 1.1.3
* Documentation correction process_sinan_dengue function.

# microdatasus 1.1.2
* Document and export process_sinan_dengue function.

# microdatasus 1.1.1
* Fix NAT_JUR field at CNES files.

Expand Down
19 changes: 18 additions & 1 deletion R/process_sinan_dengue.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
#' Process SINAN Dengue variables from DataSUS
#'
#' \code{process_sinan_dengue} processes SINAN Dengue variables retrieved by \code{fetch_datasus()}.
#'
#' This function processes SINAN Dengue variables retrieved by \code{fetch_datasus()}, informing labels for categoric variables including NA values.
#'
#' @param data \code{data.frame} created by \code{fetch_datasus()}.
#' @param municipality_data optional logical. \code{TRUE} by default, creates new variables in the dataset informing the full name and other details about the municipality of residence.
#'
#' @examples \dontrun{
#' df <- fetch_datasus(year_start = 2016, year_end = 2016, uf = "RJ", information_system = "SINAN-DENGUE-FINAL")
#' df <- process_sinan_dengue(year_start = 2016, year_end = 2016, uf = "RJ")
#' df_a <- process_sinan_dengue(df)
#' df_b <- process_sinan_dengue(df, municipality_data = FALSE)
#' }
#' @export

process_sinan_dengue <- function(data, municipality_data = TRUE){
# Variables names
variables_names <- names(data)
Expand Down Expand Up @@ -626,7 +643,7 @@ process_sinan_dengue <- function(data, municipality_data = TRUE){
# CLINC_CHIK
if ("CLINC_CHIK" %in% variables_names) {
data$CLINC_CHIK <- as.numeric(levels(data$CLINC_CHIK))[data$CLINC_CHIK]
data$CLINC_CHIK[data$CLINC_CHIK == 1] <- "Aguga"
data$CLINC_CHIK[data$CLINC_CHIK == 1] <- "Aguda"
data$CLINC_CHIK[data$CLINC_CHIK == 2] <- "Cr\u00f4nica"
data$CLINC_CHIK <- factor(data$CLINC_CHIK)
}
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ dados <- process_sim(dados)
O manual para a utilização do pacote encontra-se na [Wiki do projeto](https://github.com/rfsaldanha/microdatasus/wiki).

### Sistemas de Informação em Saúde suportados
* Download: SIM, SINASC, SIH, CNES, SIA, SINAN-CHIKUNGUNYA.

* Download: SIM, SINASC, SIH, CNES, SIA, SINAN-DENGUE, SINAN-CHIKUNGUNYA.
* Pré-processamento: SIM, SINASC, SIH-RD, CNES-ST, CNES-PF, SINAN-DENGUE, SINAN-CHIKUNGUNYA.

## Agradecimento
Expand Down
16 changes: 16 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Test environments
* local R installation, R 3.6.3
* ubuntu 16.04 (on travis-ci), R 3.6.3
* win-builder (devel)

## R CMD check results

0 errors | 0 warnings | 1 note

checking installed package size
installed size is 6.1Mb
sub-directories of 1Mb or more:
data 5.6Mb

* There is a file at data folder, called cadger.rda with 4.7 MB (compressed). This file is needed for the users to easily add health units names to preprocessed data.
* This is a new release.
26 changes: 26 additions & 0 deletions man/process_sinan_dengue.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 80c1721

Please sign in to comment.