R/helpers.R

Defines functions .try_require

# Very same function as in ggplot2 - all credit goes to Hadley Wickham
# Just here to avoid a dependency on ggplot2
#
.try_require <- function(package){
  available <- suppressMessages(suppressWarnings(sapply(package, 
      require, quietly = TRUE, character.only = TRUE, warn.conflicts = FALSE)))
  missing <- package[!available]
  if (length(missing) > 0) 
    stop(paste(package, collapse = ", "), " package required for this functionality.  Please install and try again.", call. = FALSE)
}

Try the inspectr package in your browser

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

inspectr documentation built on May 2, 2019, 5:45 p.m.