- Notifications
You must be signed in to change notification settings - Fork2
eddelbuettel/rcppmsgpack
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This package providesR with both theMessagePack (or MsgPack as a shorthand) header files, and the ability toaccess, create and alterMessagePack objects directly fromR.
MessagePack is an efficient binary serialization format. It lets youexchange data among multiple languages like JSON. But it is faster and smaller. Small integersare encoded into a single byte, and typical short strings require only one extra byte inaddition to the strings themselves.MessagePack is used by Redis andmany other projects.
TheR Journal paper describes both theRcppMsgPackpackage andMessagePack.
To use the headers from this package, simply add it to theLinkingTo: field in theDESCRIPTION field of your R package---and the R package infrastructure tools will then knowhow to set include flags correctly on all architectures supported by R.
The functionsmsgpack_pack andmsgpack_unpack allow you to serialize and de-serialize Robjects respectively.msgpack_format is a helper function to properly format R objects forinput.msgpack_simplify is a helper function to simplify output from MsgPack conversion.
MsgPack EXT types are converted to raw vectors with EXT attributes containing the extensiontype. The extension type must be an integer from 0 to 127. MsgPack Timestamps are an EXT withtype -1. Timestamps can be encoded and decoded fromPOSIXct objects in R to MsgPack formatwithmsgpack_timestamp_encode andmsgpack_timestamp_decode.
Msgpack Maps are converted to data.frames with additional class "map". Map objects in Rcontain key and value list columns and can be simplified to named lists or named vectors. Thehelper functionmsgpack_map creates map objects that can be serialized into msgpack.
A flowchart describing the conversion of R objects into msgpackobjects and back.
For more information on msgpack types, seehere.
x <- as.list(1:1e6)x_packed <- msgpack_pack(x)x_unpacked <- msgpack_unpack(x_packed)The package is onCRAN and can be installed via a standard
install.packages("RcppMsgPack")Pre-releases have been available via theghrr dratrepository:
drat::addRepo("ghrr")install.packages("RcppMsgPack")The package currently includes the MessagePack headers version 2.1.5.
See theBH package for related (and alsoheader-only) libraries fromBoost, and theRcppRedis package for simple yet performantRedis support.
Theissue trackercan be used for bug reports or feature requests.
Dirk Eddelbuettel andTravers Ching.
Special thanks toXun Zhu.
The R package is provided under the GPL (version 2 or later). The includedMsgPack library is released under the same license as Boost, the BSL-1.0.
About
MsgPack Headers for R / msgpack.org[R]
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.