read.dbc
An R package for reading data in the DBC (compressed DBF) format used by DATASUS.
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
Repository
An R package for reading data in the DBC (compressed DBF) format used by DATASUS.
Statistics
- Stars: 76
- Watchers: 11
- Forks: 30
- Open Issues: 2
- Releases: 1
Metadata Files
README.md
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.cheader and usage notes.src/dbc2dbf.c: the main program to decompress the dbc files to dbf.R/read.dbc.R: the code for reading.dbcfiles within R.R/dbc2dbf.R: a helper function to decompress the.dbcfiles, it works as a wrapper to the "blast" code.man/*: package manualsinst/*: 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
- Website: https://www.ko-fi.com/danicat
- Twitter: danicat83
- Repositories: 79
- Profile: https://github.com/danicat
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
Top Committers
| Name | 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
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
- Homepage: https://github.com/danicat/read.dbc
- Documentation: http://cran.r-project.org/web/packages/read.dbc/read.dbc.pdf
- License: AGPL-3
- Status: removed
-
Latest release: 1.0.7
published about 2 years ago
Rankings
Maintainers (1)
pypi.org: readdbc
Ler arquivos .dbc do datasus
- Documentation: https://readdbc.readthedocs.io/
- License: MIT
-
Latest release: 0.2.0
published over 2 years ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.3.0 depends
- foreign * imports
- 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