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())
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.
an object, typically a list
the minimum length of a character vector for
char_map
to be applied
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.
additional classes to set on the char_map
-objects
created by compress_chars
. For uncompress_chars
, only call
map2char
on those char_map
-objects which
additionally inherit from all these classes.
Fully supported on Windows.