Marshalling of 'data.table' objects

# S3 method for class 'data.table'
marshal(x, ...)

# S3 method for class 'data.table'
marshallable(...)

Arguments

x

A data.table::data.table object.

...

Not used.

Value

A marshalled object as described in marshal().

Examples

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