Fast, lossless compression using the Zstandard algorithm
# Install the development version from GitHub:
## install.packages("devtools")
devtools::install_github("sbearrows/zstd")
Simple data compression example:
library(zstd)
# simple compression and decompression
input <- readBin("input", what = 'raw', n = file.size("input"))
output <- compression(input, level = 10)
original <- decompression(output)
# streamable compression
stream_compression("input", "output.zst", level = 10)
# streamable decompression
stream_decompression("output.zst", "original")