msgpack_write: 'MsgPack' write

Description Usage Arguments Examples

View source: R/functions.r

Description

A helper function to serialize an object and write it to a file, or a connection.

Usage

1
2
3
msgpack_write(..., msg = NULL, file, mode = "auto")

msgpackWrite(..., msg = NULL, file, mode = "auto")

Arguments

...

Serializable R objects.

msg

Message to write to file. If not NULL and a raw vector, write it instead of the R objects. Default: NULL.

file

A connection, or a string describing the file or pipe to write to, depending on the mode.

mode

One of "auto", "file", "gzip" or "pipe". If "auto", detects based on the file string (any space == pipe, ".gz" == gzip, file otherwise). Ignored if file is a connection.

Examples

1
2
3
tmp <- tempfile(fileext=".gz")
msgpack_write(1:10, file=tmp)
x <- msgpack_read(tmp, simplify=TRUE)

Example output



RcppMsgPack documentation built on May 2, 2019, 3:44 a.m.