R/utils.R

Defines functions red silver has_crayon is_installed

is_installed <- function(pkg) {
  is_true(requireNamespace(pkg, quietly = TRUE))
}

has_crayon <- function() {
  is_installed("crayon") && crayon::has_color()
}

silver <- function(x) if (has_crayon()) crayon::silver(x) else x
red <- function(x) if (has_crayon()) crayon::red(x) else x

Try the cliff package in your browser

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

cliff documentation built on Nov. 2, 2021, 9:09 a.m.