Serializes an object to a raw vector using the qdata format.
The object to save.
The compression level used (default: qopt("compress_level"), initial value is 3L.
The maximum and minimum possible values depend on the version of the ZSTD library used. As of ZSTD 1.5.6 the maximum compression level is 22, and the minimum is -131072. Usually, values in the low positive range offer very good performance in terms of speed and compression.
Whether to allow byte shuffling when compressing data (default: qopt("shuffle"), initial value is TRUE).
Whether to warn when saving an object with an unsupported type (default: qopt("warn_unsupported_types"), initial value is TRUE).
The number of threads to use when compressing data (default: qopt("nthreads"), initial value is 1L.
The serialized object as a raw vector.
x <- data.frame(int = sample(1e3, replace=TRUE),
num = rnorm(1e3),
char = sample(state.name, 1e3, replace=TRUE),
stringsAsFactors = FALSE)
xserialized <- qd_serialize(x)
x2 <- qd_deserialize(xserialized)
identical(x, x2) # returns TRUE
#> [1] TRUE