serialize_pb | R Documentation |
Serializes R objects to a general purpose protobuf message using the same
rexp.proto
descriptor and mapping between R objects and protobuf
mesages as RHIPE.
serialize_pb(object, connection, ...)
object |
R object to serialize |
connection |
passed on to |
... |
additional arguments passed on to |
Clients need both the message and the rexp.proto
descriptor to parse
serialized R objects. The latter is included in the the package installation
proto
directory: system.file(package="RProtoBuf", "proto/rexp.proto")
The following storage types are natively supported by the descriptor:
character
, raw
, double
, complex
, integer
,
list
, and NULL
. Objects with other storage types, such as
functions, environments, S4 classes, etc, are serialized using base R
serialize
and stored in the proto native
type.
Missing values, attributes and numeric precision will be preserved.
msg <- tempfile();
serialize_pb(iris, msg);
obj <- unserialize_pb(msg);
identical(iris, obj);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.