View source: R/marshal.data.table.R
marshal.data.table | R Documentation |
Marshalling of 'data.table' objects
## S3 method for class 'data.table'
marshal(x, ...)
## S3 method for class 'data.table'
marshallable(...)
x |
A data.table::data.table object. |
... |
Not used. |
A marshalled
object as described in marshal()
.
if (requireNamespace("data.table", quietly = TRUE)) {
dt <- data.table::data.table(a = 1:3, b = letters[1:3])
## Marshal
dt_ <- marshal(dt)
## Unmarshal
dt2 <- unmarshal(dt_)
stopifnot(identical(dt2, dt))
## Marshal and unmarshal again
dt2_ <- marshal(dt2)
dt3 <- unmarshal(dt2_)
stopifnot(
identical(dt2_, dt_),
identical(dt3, dt2)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.