R/util.R

Defines functions bin_to_object object_to_bin list_to_character `%||%`

`%||%` <- function(x, y) { # nolint
  if (is.null(x)) y else x
}

list_to_character <- function(x) {
  vapply(x, identity, character(1))
}

object_to_bin <- function(obj) {
  serialize(obj, NULL, xdr = FALSE)
}

bin_to_object <- function(bin) {
  unserialize(bin)
}
mrc-ide/kelp documentation built on Dec. 21, 2021, 10:04 p.m.