Description Usage Arguments Examples
View source: R/serialisation.R
Serialise/deserialise an R object into a string. This is a very
thin wrapper around the existing R functions
serialize
and rawToChar
. This is
useful to encode arbitrary R objects as string to then save in
Redis (which expects a string).
1 2 3 4 5 6 7 | object_to_string(obj)
string_to_object(str)
object_to_bin(obj, xdr = FALSE)
bin_to_object(bin)
|
obj |
An R object to convert into a string |
str |
A string to convert into an R object |
xdr |
Use the big-endian representation? Unlike,
|
bin |
A binary vector to convert back to an R object |
1 2 3 4 | s <- object_to_string(1:10)
s
string_to_object(s)
identical(string_to_object(s), 1:10)
|
[1] "A\n3\n262147\n197888\n5\nUTF-8\n238\n2\n1\n262153\n14\ncompact_intseq\n2\n1\n262153\n4\nbase\n2\n13\n1\n13\n254\n14\n3\n0x1.4p+3\n0x1p+0\n0x1p+0\n254\n"
[1] 1 2 3 4 5 6 7 8 9 10
[1] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.