qs (version 0.26.1)

zstd_compress_raw: Zstd compression

Description

Compresses to a raw vector using the zstd algorithm. Exports the main zstd compression function.

Usage

zstd_compress_raw(x, compress_level)

Value

The compressed data as a raw vector.

Arguments

x

The object to serialize.

compress_level

The compression level used (default 4). A number between -50 to 22 (higher is more compressed). Due to the format of qs, there is very little benefit to compression levels > 5 or so.

Examples

Run this code
x <- 1:1e6
xserialized <- serialize(x, connection=NULL)
xcompressed <- zstd_compress_raw(xserialized, compress_level = 1)
xrecovered <- unserialize(zstd_decompress_raw(xcompressed))

Run the code above in your browser using DataLab