read.dbc: Read Data Stored in DBC (Compressed DBF) Files

View source: R/read.dbc.R

read.dbcR Documentation

Read Data Stored in DBC (Compressed DBF) Files

Description

This function allows you to read a DBC (compressed DBF) file into a data frame.

Usage

read.dbc(file, ...)

Arguments

file

The name of the DBC file (including extension)

...

Further arguments to be passed to read.dbf

Details

DBC is the extension for compressed DBF files (from the 'XBASE' family of databases). This is a proprietary file format used by the Brazilian government to publish public healthcare data, and it is not related to the FoxPro or CANdb DBC file formats.

The read.dbc function will decompress the input DBC file into a temporary DBF file and call read.dbf from the foreign package to read it into a data frame.

Value

A data.frame of the data from the DBC file.

Note

DATASUS is the name of the Department of Informatics of the Brazilian Health System (Sistema Único de Saúde - SUS) and is responsible for publishing public healthcare data in Brazil. Besides the DATASUS, the Brazilian National Agency for Supplementary Health (ANS) also uses this file format for its public data.

This function was tested using files from both DATASUS and ANS to ensure compliance with the format, and hence ensure its usability by researchers.

Neither this project, nor its author, has any association with the Brazilian government.

Author(s)

Daniela Petruzalek, daniela.petruzalek@gmail.com

See Also

dbc2dbf

Examples

# The 'sids.dbc' file is the compressed version of 'sids.dbf' from the "foreign" package.
file <- system.file("files/sids.dbc", package="read.dbc")
sids <- read.dbc(file)
str(sids)
summary(sids)

# This is a small subset of U.S. NOAA storm database.
file <- system.file("files/storm.dbc", package="read.dbc")
storm <- read.dbc(file)
head(storm)
str(storm)


read.dbc documentation built on May 29, 2024, 3:06 a.m.