R/util.R

Defines functions is_tdigest is_null_xptr

Documented in is_tdigest

is_null_xptr <- function(x) {
  .Call("is_null_xptr_", x, PACKAGE="tdigest")
}

#' @rdname td_create
#' @param td t-digest object
#' @export
is_tdigest <- function(td) {
  if (inherits(td, "tdigest")) {
    if (is_null_xptr(td)) {
      message("Object was a populated tdigest but is now an invalid xptr")
      FALSE
    } else {
      TRUE
    }
  } else {
    FALSE
  }
}

Try the tdigest package in your browser

Any scripts or data that you put into this service are public.

tdigest documentation built on Oct. 5, 2022, 1:07 a.m.