Type: | Package |
Title: | R API Serialization |
Version: | 0.1.4 |
Date: | 2024-09-28 |
Description: | Access to the internal R serialization code is provided for use by other packages at the C function level by using the registration of native function mechanism. Client packages simply include a single header file RApiSerializeAPI.h provided by this package. This packages builds on the Rhpc package by Ei-ji Nakama and Junji Nakano which also includes a (partial) copy of the file src/main/serialize.c from R itself. The R Core group is the original author of the serialization code made available by this package. |
URL: | https://github.com/eddelbuettel/rapiserialize, https://dirk.eddelbuettel.com/code/rapiserialize.html |
BugReports: | https://github.com/eddelbuettel/rapiserialize/issues |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
NeedsCompilation: | yes |
Packaged: | 2024-09-28 16:23:20 UTC; edd |
Author: | Dirk Eddelbuettel |
Maintainer: | Dirk Eddelbuettel <edd@debian.org> |
Repository: | CRAN |
Date/Publication: | 2024-09-28 16:50:02 UTC |
R API for Serialization
Description
This package provides other packages with access to the internal R serialization code. Access is provided at the C function level via the registered function facility
For convenience and testing purposes, two wrapper functions are also provided at the R level.
Usage
serializeToRaw(obj, version=2, xdr=TRUE)
unserializeFromRaw(obj)
Arguments
obj |
An R object which is going to (un)serialized by the corresponding function. |
version |
An integer selection the R serialization format. Default is 2, and values 2 or 3 are currently supported. |
xdr |
A logical value selection (portable) XDR encoding which is the
default. Use |
Details
The C code in this package is taken from R source code, where it provided for use by R only in a way that renders it inaccessible to other packages.
This package aims to fill this gap by providing access to the same functionality, at the cost of making a copy.
To use the serialization and deserialization code provided here, a
client package simply adds LinkingTo: RApiSerialize
in its
DESCRIPTION
file and includes the header file
RApiSerializeAPI.h
.
Author(s)
Dirk Eddelbuettel put together this package, based on earlier work by Ei-ji Nakama and Junji Nakano who also included the C code from R for serialization in their Rhpc package. R Core wrote the underlying C code for use in R itself.
The package is maintained by Dirk Eddelbuettel.
See Also
The R source code in src/main/serialize.c
.
Examples
## calling the R wrapper
serializeToRaw(letters)