Package: datasusr 0.1.0

Andre Leite

datasusr: Fast Access to Brazilian Public Health Data from 'DATASUS'

Provides fast, in-memory reading of 'DATASUS' 'DBC' files using native 'C' code, along with a catalog of public health data sources, 'FTP' file discovery, caching downloads, and a high-level datasus_fetch() function that lists, downloads, and reads files in a single call. Bundles the 'blast' decompressor from 'zlib' contrib/blast to decode 'PKWare DCL' compressed 'DBC' files and parses 'DBF' records directly for efficient import into tibbles. See the 'DATASUS' file transfer site <https://datasus.saude.gov.br> and Adler (2003) <https://github.com/madler/zlib/tree/master/contrib/blast> for details on the underlying data and compression format.

Authors:Andre Leite [aut, cre], Marcos Wasilew [aut], Hugo Vasconcelos [aut], Carlos Amorim [aut], Diogo Bezerra [aut], Mark Adler [ctb, cph]

datasusr_0.1.0.tar.gz
datasusr_0.1.0.zip(r-4.7)datasusr_0.1.0.zip(r-4.6)datasusr_0.1.0.zip(r-4.5)
datasusr_0.1.0.tgz(r-4.6-x86_64)datasusr_0.1.0.tgz(r-4.6-arm64)datasusr_0.1.0.tgz(r-4.5-x86_64)datasusr_0.1.0.tgz(r-4.5-arm64)
datasusr_0.1.0.tar.gz(r-4.7-arm64)datasusr_0.1.0.tar.gz(r-4.7-x86_64)datasusr_0.1.0.tar.gz(r-4.6-arm64)datasusr_0.1.0.tar.gz(r-4.6-x86_64)
datasusr_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
datasusr/json (API)

# Install 'datasusr' in R:
install.packages('datasusr', repos = c('https://strategicprojects.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/strategicprojects/datasusr/issues

Pkgdown/docs site:https://strategicprojects.github.io

On CRAN:

Conda:

4.88 score 241 downloads 18 exports 21 dependencies

Last updated from:12b4e7f68e. Checks:11 NOTE, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64NOTE161
linux-devel-x86_64NOTE129
source / vignettesOK188
linux-release-arm64NOTE142
linux-release-x86_64NOTE140
macos-release-arm64NOTE131
macos-release-x86_64NOTE139
macos-oldrel-arm64NOTE118
macos-oldrel-x86_64NOTE147
windows-develNOTE106
windows-releaseNOTE102
windows-oldrelNOTE89
wasm-releaseOK117

Exports:datasus_build_pathdatasus_cache_cleardatasus_cache_dirdatasus_cache_infodatasus_cache_listdatasus_cache_prunedatasus_docs_urldatasus_downloaddatasus_fetchdatasus_file_typesdatasus_ftp_lsdatasus_get_territorydatasus_list_filesdatasus_modalitiesdatasus_sourcesdatasus_ufsformat_bytesread_datasus_dbc

Dependencies:clicpp11curldplyrgenericsgluelifecyclemagrittrpillarpkgconfigpurrrR6rlangstringistringrtibbletidyrtidyselectutf8vctrswithr

Cache and downloads
How caching works | Configuring the cache directory | Inspecting the cache | Forcing a re-download | Pruning and clearing the cache

Last update: 2026-04-29
Started: 2026-04-01

Comparison with healthbR and microdatasus
TL;DR — when to use what | Feature comparison | Reading DBC files | API ergonomics | Caching and parallelism | Variable labelling | Composing the packages | Summary

Last update: 2026-04-29
Started: 2026-04-01

Available data sources
Source catalog overview | Hospital information (SIH) | Outpatient information (SIA) | Mortality (SIM) | Live births (SINASC) | Health facilities (CNES) | Hospital and outpatient reporting (CIHA / CIH) | Notifiable diseases (SINAN) | Other disease surveillance | Oncology panel | Schistosomiasis control (PCE) | Discontinued and replaced systems | Territorial reference tables | Documentation and data dictionaries | Connectivity check | Cleaning up

Last update: 2026-04-01
Started: 2026-04-01

Getting started with datasusr
The fastest way: datasus_fetch() | Reading a local DBC file | Selecting columns | Controlling column types | Exploring available data | Step-by-step workflow | Territorial data (municipalities, regions) | Finding documentation and data dictionaries | Next steps

Last update: 2026-04-01
Started: 2026-04-01

Performance notes
Column selection | Type inference | Explicit types | Date parsing | Benchmarking example | Memory

Last update: 2026-04-01
Started: 2026-04-01