deflate_compress | R Documentation |
Compress the given raw vector using the specified libdeflate compressor.
deflate_compress(compressor, input)
compressor |
An external pointer created by 'alloc_compressor()'. |
input |
A raw vector (or object coercible to raw) containing the data to compress. |
A raw vector containing the DEFLATEācompressed output.
# Low compression values might not compress at all
cmp = alloc_compressor(1L)
raw_in = charToRaw("Fast compression test: 1231231231231231")
raw_cmp_1 = deflate_compress(cmp, raw_in)
print(sprintf("Length in: %i Length out: %i", length(raw_in), length(raw_cmp_1) ))
# Max compression is 12
cmp = alloc_compressor(12L)
raw_cmp_12 = deflate_compress(cmp, raw_in)
print(sprintf("Length in: %i Length out: %i", length(raw_in), length(raw_cmp_12) ))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.