compress | R Documentation |
Compresses the provided raw data in a single step.
compress(
data,
level = -1,
method = zlib$DEFLATED,
wbits = zlib$MAX_WBITS,
memLevel = zlib$DEF_MEM_LEVEL,
strategy = zlib$Z_DEFAULT_STRATEGY,
zdict = NULL
)
data |
Raw data to be compressed. |
level |
Compression level, default is -1. |
method |
Compression method, default is |
wbits |
Window bits, default is |
memLevel |
Memory level, default is |
strategy |
Compression strategy, default is |
zdict |
Optional predefined compression dictionary as a raw vector. |
The compress
function simplifies the compression process by encapsulating
the creation of a compression object, compressing the data, and flushing the buffer
all within a single call. This is particularly useful for scenarios where the user
wants to quickly compress data without dealing with the intricacies of compression
objects and buffer management. The function leverages the compressobj
function
to handle the underlying compression mechanics.
A raw vector containing the compressed data.
compressed_data <- compress(charToRaw("some data"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.