blosc_compress | R Documentation |
Use the Blosc library to compress or decompress data.
blosc_compress(
x,
compressor = "blosclz",
level = 7L,
shuffle = "noshuffle",
typesize = 4L,
...
)
blosc_decompress(x, ...)
x |
In case of In case of |
compressor |
The compression algorithm to be used. Can be any of
|
level |
An |
shuffle |
A shuffle filter to be activated before compression.
Should be one of |
typesize |
BLOSC compresses arrays of structured data. This argument
specifies the size ( |
... |
Arguments passed to |
In case of blosc_compress()
a vector of compressed raw
data is returned. In case of blosc_decompress()
returns a vector of
decompressed raw
data. Or in in case dtype
(see dtype_to_r()
) is
specified, a vector of the specified type is returned.
my_dat <- as.raw(sample.int(2L, 10L*1024L, replace = TRUE) - 1L)
my_dat_out <- blosc_compress(my_dat, typesize = 1L)
my_dat_decomp <- blosc_decompress(my_dat_out)
## After compressing and decompressing the data is the same as the original:
all(my_dat == my_dat_decomp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.