R/atomic_coercions.R

Defines functions as.character.Set as.double.Tuple as.double.Set

#' @export
as.double.Set <- function(x, ...) {
  if (testFuzzy(x)) {
    return(sort(unlist(x$support())))
  } else {
    return(sort(unlist(x$elements)))
  }
}

#' @export
as.double.Tuple <- function(x, ...) {
  if (testFuzzy(x)) {
    return(unlist(x$support()))
  } else {
    return(unlist(x$elements))
  }
}

#' @export
as.character.Set <- function(x, n = 1e10, ...) {
  x$strprint(n = n)
}

Try the set6 package in your browser

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

set6 documentation built on Oct. 18, 2021, 5:06 p.m.