Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MsgPack Headers for R / msgpack.org[R]

NotificationsYou must be signed in to change notification settings

eddelbuettel/rcppmsgpack

Repository files navigation

CILicenseCRANDependenciesDownloadsLast CommitRJournal

About

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.

Usage

C++ headers

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.

Interface functions

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.

flowchartA flowchart describing the conversion of R objects into msgpackobjects and back.

For more information on msgpack types, seehere.

Example:

x <- as.list(1:1e6)x_packed <- msgpack_pack(x)x_unpacked <- msgpack_unpack(x_packed)

Installation

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")

Status

The package currently includes the MessagePack headers version 2.1.5.

See Also

See theBH package for related (and alsoheader-only) libraries fromBoost, and theRcppRedis package for simple yet performantRedis support.

Bug Reports

Theissue trackercan be used for bug reports or feature requests.

Author

Dirk Eddelbuettel andTravers Ching.

Acknowledgements

Special thanks toXun Zhu.

License

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp