deflate | R Documentation |
Compress a raw GZIP stream
deflate(buffer, level = 6L, pos = 1L, size = NULL)
buffer |
Raw vector, containing the data to compress. |
level |
Compression level, integer between 1 (fatest) and 9 (best). |
pos |
Start position of data to compress in |
size |
Compressed size estimate, or |
Named list with three entries:
output
: raw vector, the compressed data,
bytes_read
: number of bytes used from buffer
,
bytes_written
: number of bytes written to the output buffer.
base::memCompress()
does the same with type = "gzip"
,
but it does not tell you the number of bytes read from the input.
data_gz <- deflate(charToRaw("Hello world!"))
inflate(data_gz$output)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.