These functions are equivalent to base::serialize()
and
base::unserialize()
but try to preserve the enclosure of
closures, formulas, and quosures. It works by detecting which
environment or package attached on the search path at
serialisation-time are required by the function or quosure. The
relevant environments are then reconstructed in a fake search path
when the object is unserialised. The fake search path is specific
to each closure and quosure.
1 2 3 4 5 6 7 8 9 10 11 12 13 | serialise_bytes(x, global_env = FALSE)
## Default S3 method:
serialise_bytes(x, global_env = FALSE)
bytes_unserialise(bytes)
## Default S3 method:
bytes_unserialise(bytes)
serialize_bytes(x, global_env = FALSE)
bytes_unserialize(bytes)
|
x |
An object to serialise. |
global_env |
Whether to include a stripped version of the global environment as part of the fake search path constructed around closures. |
bytes |
A raw vector to unserialise. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.