| komp_compress | R Documentation |
Bytes in, bytes out. Character input is not accepted: encoding is a
decision the caller must make explicitly, so convert with
charToRaw() or iconv() first.
komp_compress(x, codec = "gzip", level = NULL)
x |
A raw vector. |
codec |
Codec name, as listed in |
level |
Compression level. Either a codec-native whole number, one of
the abstract names Numeric levels are not comparable between codecs: |
A raw vector.
komp_decompress(), komp_codecs()
x <- charToRaw(strrep("compress me ", 100))
z <- komp_compress(x)
length(x)
length(z)
identical(komp_decompress(z, "gzip"), x)
# gzip output is deterministic: no timestamp, no filename
identical(komp_compress(x), komp_compress(x))
# abstract levels port across codecs; numeric ones do not
length(komp_compress(x, level = "fast"))
length(komp_compress(x, level = "best"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.