compressobj | R Documentation |
compressobj
initializes a new compression object with specified parameters
and methods. The function makes use of publicEval
to manage scope and encapsulation.
compressobj(
level = -1,
method = zlib$DEFLATED,
wbits = zlib$MAX_WBITS,
memLevel = zlib$DEF_MEM_LEVEL,
strategy = zlib$Z_DEFAULT_STRATEGY,
zdict = NULL
)
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. |
Returns an environment containing the public methods compress
and flush
.
compress(data)
: Compresses a chunk of data.
flush()
: Flushes the compression buffer.
compressor <- compressobj(level = 6)
compressed_data <- compressor$compress(charToRaw("some data"))
compressed_data <- c(compressed_data, compressor$flush())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.