View source: R/compress_chars.R
compress_chars | R Documentation |
char_map
/map2char
on a ListThese originally internal functions are exported because they are also useful
for reducing the size of e.g. a data frame before storing it to disk using
saveRDS
. This also improves the (de)serialization speed.
compress_chars(
l,
limit = 0L,
compress_altreps = c("if_allocated", "yes", "no"),
class = character()
)
uncompress_chars(l, class = character())
l |
an object, typically a list |
limit |
the minimum length of a character vector for
|
compress_altreps |
should a character vector be compressed if it is an ALTREP? The default "if_allocated" only does so if the regular representation was already created. This was chosen as the default because in this case is is the regular representation which would be serialized. |
class |
additional classes to set on the |
For compress_chars
, l
, but with character vectors
replaced by objects of class char_map
. For
uncompress_chars
, l
, but with all
char_map
-objects, which also inherit from all classes given
in class
, replaced by the original character vectors.
Fully supported on Windows.
The object returned by compress_chars
might be an invalid S3
object, e.g. if l
is a data frame. These functions are intended to
be called immediately before and after (de)serializing the object, i.e.
compress -> serialize -> store/transfer -> de-serialize -> uncompress.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.