R/regPackage.R

#' Empirical Best Prediction of poverty indicators
#'
#' Function \code{registerPackages} 
#' @param 
#' @return bla
#'
#' @details longbla
#' @export





registerPackage <- function(pck){
  status <- myHPCtools:::getPackage(name = pck)
  if(status == "failed"){
    return(NULL) 
  } else {
    desc <- packageDescription(pck)
    dep <- getCleanString(unlist(strsplit(c(desc$Depends, desc$Imports), split = ",")))
  }
}


getCleanString <- function(dep){
  dep <- sub("\\(.*?\\)", "", dep)
  dep <- sub("\n", "", dep)
  dep <- gsub(" ", "", dep)
  dep <- dep[dep != "R"]
  return(dep)
}

registerPackage("gridExtra")
SoerenPannier/myHPCtools documentation built on May 9, 2019, 1:50 p.m.