R/require_packages.R

Defines functions require_network require_igraph require_shiny

require_shiny <- function(cap=NULL){
  if(is.null(cap)) cap <- "This capability"
  if(!requireNamespace("shiny", quietly=TRUE)){
    stop(cap, " requires the R package ", sQuote("shiny"), " to be installed.", call.=FALSE)
  }
}

require_igraph <- function(cap=NULL){
  if(is.null(cap)) cap <- "This capability"
  if(!requireNamespace("igraph", quietly=TRUE)){
    stop(cap, " requires the R package ", sQuote("igraph"), " to be installed.", call.=FALSE)
  }
}

require_network <- function(cap=NULL){
  if(is.null(cap)) cap <- "This capability"
  if(!requireNamespace("network", quietly=TRUE)){
    stop(cap, " requires the R package ", sQuote("network"), " to be installed.", call.=FALSE)
  }
}
tilltnet/egor documentation built on Feb. 12, 2024, 3:21 a.m.