transform_data: Transform DATASUS data according to a dictionary

Description Usage Arguments Examples

Description

Transform DATASUS data according to a dictionary

Usage

1
2
transform_data(data, dict, keep = NULL, language = c("en", "br"),
  quiet = FALSE)

Arguments

data

a data frame to transform

dict

a dictionary to use for the transformation

keep

an optional vector of column names to keep (others will be omitted)

language

should the resulting transformed data be in English or Portuguese? Currently not implemented.

quiet

logical - should messages be suppressed?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
d <- transform_data(sinasc_example, subset(cdcs_dict, db == "SINASC"))

## Not run: 
fin <- "ftp://ftp.datasus.gov.br/dissemin/publicos/SINASC/NOV/DNRES/DNRO2013.DBC"
fout <- tempfile(fileext = ".DBC")
download.file(fin, destfile = fout)
d <- read_datasus(fout)
d <- transform_data(d, subset(cdcs_dict, db == "SINASC"))

## End(Not run)

ki-tools/cidacsdict documentation built on May 12, 2019, 10:51 a.m.