read.dbc

An R package for reading data in the DBC (compressed DBF) format used by DATASUS.

https://github.com/danicat/read.dbc

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

An R package for reading data in the DBC (compressed DBF) format used by DATASUS.

Basic Info
  • Host: GitHub
  • Owner: danicat
  • Language: C
  • Default Branch: master
  • Homepage:
  • Size: 136 KB
Statistics
  • Stars: 76
  • Watchers: 11
  • Forks: 30
  • Open Issues: 2
  • Releases: 1
Created about 10 years ago · Last pushed about 1 year ago
Metadata Files
Readme Funding

README.md

R-CMD-check <!-- badges: end -->

read.dbc

Author: Daniela Petruzalek
e-mail: daniela.petruzalek@gmail.com
License: AGPLv3

Introduction

read.dbc is a R package to enable importing data from DBC (compressed DBF) files into data frames. Please note that this is the file format used by DATASUS and it is not related to Microsoft FoxPro or CANdb DBC file formats.

DATASUS is the name of the Department of Informatics of Brazil's Healthcare System (Sistema Unico de Saúde - SUS). They are responsible for publishing Brazilian public healthcare data. Besides DATASUS, the Brazilian National Agency for Supplementary Health (ANS) also uses this file format for its public data.

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

This project is based on the work of Mark Adler (blast) and Pablo Fonseca (blast-dbf).

Neither this project, nor its author, is related in any way to the Brazilian government.

Changelog

For a complete description of the changes, please check CHANGELOG.md.

Repository Contents

  • README.md: this file.
  • CHANGELOG.md: change history.
  • src/blast.c: decompression tools for PKWare Data Compression Library (DCL).
  • src/blast.h: blast.c header and usage notes.
  • src/dbc2dbf.c: the main program to decompress the dbc files to dbf.
  • R/read.dbc.R: the code for reading .dbc files within R.
  • R/dbc2dbf.R: a helper function to decompress the .dbc files, it works as a wrapper to the "blast" code.
  • man/*: package manuals
  • inst/*: test and misc files

Installation

As of June, 7 of 2016, this package officialy became part of CRAN (The Comprehensive R Archive Network). Therefore, it's current stable version can be installed by running install.packages:

    install.packages("read.dbc")

In case you want to install the development version of this package, you still can do it using the devtools library:

    devtools::install_github("danicat/read.dbc")

Usage

Reading a DBC file to a data frame:

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

    # The following code will download data from the "Declarations of Death" database for
    # the Brazilian state of Parana, year 2013. Source: DATASUS / Brazilian Ministry of Health
    url <- "ftp://ftp.datasus.gov.br/dissemin/publicos/SIM/CID10/DORES/DOPR2013.dbc"
    download.file(url, destfile = "DOPR2013.dbc", mode = "wb")
    dopr <- read.dbc("DOPR2013.dbc")
    head(dopr)
    str(dopr)

Decompressing a DBC file to a DBF:

    # Input file name
    in.f  <- system.file("files/sids.dbc", package = "read.dbc")

    # Output file name
    out.f <- tempfile(fileext = ".dbc")

    # The call return logi = TRUE on success
    if( dbc2dbf(input.file = in.f, output.file = out.f) ) {
         print("File decompressed!")
         file.remove(out.f)
    }

Contact Info

If you have any questions, please contact me at daniela.petruzalek@gmail.com.

Developer Information

Mac OS X

Setup: - Install Xcode - Install R: https://cran.r-project.org/bin/macosx/ - Install Rstudio: https://posit.co/download/rstudio-desktop/ - Run make setup to install R dependencies - Run make check to verify the package

You can also run make help to see a list of available commands.

Submitting to CRAN

First make sure all the checks are passing by running make cran.

Once ready, use devtools::submit_cran(). This needs to run from RStudio or the R interpreter itself as the tool doesn't allow non-interactive runs.

Owner

  • Name: Daniela Petruzalek
  • Login: danicat
  • Kind: user
  • Location: London, UK
  • Company: @GoogleCloudPlatform

Developer Relations Engineer 👩‍💻🥑

GitHub Events

Total
  • Issues event: 3
  • Watch event: 10
  • Issue comment event: 9
  • Push event: 6
  • Pull request event: 5
  • Fork event: 1
  • Create event: 4
Last Year
  • Issues event: 3
  • Watch event: 10
  • Issue comment event: 9
  • Push event: 6
  • Pull request event: 5
  • Fork event: 1
  • Create event: 4

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 48
  • Total Committers: 4
  • Avg Commits per committer: 12.0
  • Development Distribution Score (DDS): 0.146
Past Year
  • Commits: 16
  • Committers: 1
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Daniela Petruzalek d****k@g****m 41
Pablo Marcondes Fonseca p****s@g****m 5
Evandro Caldeira e****a@g****m 1
Pablo Fonseca p****o@v****r 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 16
  • Total pull requests: 1
  • Average time to close issues: 5 months
  • Average time to close pull requests: 31 minutes
  • Total issue authors: 16
  • Total pull request authors: 1
  • Average comments per issue: 2.81
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 1
  • Average time to close issues: 13 days
  • Average time to close pull requests: 31 minutes
  • Issue authors: 3
  • Pull request authors: 1
  • Average comments per issue: 2.67
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • danicat (2)
  • lego-yaw (1)
  • oranzani (1)
  • filipemsc (1)
  • paeselhz (1)
  • brenoea (1)
  • GleytonLima (1)
  • pavoltravnik (1)
  • leandrobi (1)
  • gustavoalcantara (1)
  • leofontenelle (1)
  • guidcarvalho (1)
  • yvescabral (1)
  • rfsaldanha (1)
  • lucasmation (1)
Pull Request Authors
  • danicat (3)
  • google-labs-jules[bot] (1)
Top Labels
Issue Labels
bug (2) jules (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 99 last-month
    • cran 917 last-month
  • Total docker downloads: 16
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 6
    (may contain duplicates)
  • Total versions: 7
  • Total maintainers: 2
cran.r-project.org: read.dbc

Read Data Stored in DBC (Compressed DBF) Files

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 6
  • Downloads: 917 Last month
  • Docker Downloads: 16
Rankings
Forks count: 3.2%
Stargazers count: 6.1%
Downloads: 11.2%
Dependent repos count: 12.1%
Average: 12.3%
Dependent packages count: 29.0%
Last synced: almost 2 years ago
pypi.org: readdbc

Ler arquivos .dbc do datasus

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 99 Last month
Rankings
Dependent packages count: 10.0%
Average: 38.7%
Dependent repos count: 67.4%
Maintainers (1)
Last synced: over 1 year ago

Dependencies

DESCRIPTION cran
  • R >= 3.3.0 depends
  • foreign * imports
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite