fastreg converts large SAS register files (.sas7bdat)
into Apache Parquet format.
This is particularly useful for researchers working with Danish
registers at Statistics Denmark, where large SAS files are common.
Parquet files are smaller on disk, faster to read, and work well with
modern tools like DuckDB and Arrow.
A register in this context refers to a collection of related
data files, typically with yearly snapshots like
bef2020.sas7bdat, bef2021.sas7bdat (from the
BEF
register).
fastreg provides functions to:
The primary purpose of the fastreg package is to simplify the process of converting the large Danish registers into the more modern Parquet storage format as well as to simplify reading these Parquet files. By converting data from SAS to the more modern and efficient Parquet format, the package reduces storage costs and aims to improve performance in data analysis workflows.
Install from CRAN:
install.packages("fastreg")Install the latest development version from GitHub:
pak::pak("dp-next/fastreg")Use convert() to convert a single SAS file to Parquet in
Hive partition format:
fastreg::convert(
path = "path/to/file.sas7bdat",
output_dir = "path/to/output_dir/"
)Use use_template() to copy a targets template that
converts multiple registers in parallel into your project:
fastreg::use_template()Use read_register() to quickly read a specific register
(e.g. the BEF register) as a DuckDB table:
fastreg::read_register("bef")See vignette("fastreg") for a complete guide.
If you find a bug or have any questions, please add an Issue on GitHub. Please include a minimal reproducible example.
Please note that the fastreg project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.