R/utils.R

Defines functions isFALSE type

isFALSE <- function(x) identical(x, FALSE)

type <- function(val) {
  atomic <- typeof(val)
  if(is.vector(val)) {
    dims <- c(length(val))
    paste0(atomic, "[", dims , "]")
  } else if(is.array(val)) {
    dims <- dim(val)
    paste0(atomic, "[", paste(dims, collapse = ","), "]")
  } else {
    atomic
  }
}
aviralg/contractr documentation built on May 14, 2019, 8:23 a.m.