R/get_database.R

Defines functions get_database

Documented in get_database

#' Returns  database
#'
#' @param id database name
#' @param type database type
#'
#' @return
#' @export
#'
#'
get_database <- function(id, type) {

  # Check input
  if (!hasArg(id) || !hasArg(type)) {

    message("Incomplete call.")
    return(invisible(NULL))

  }

  # Make id character
  if (is.numeric(id)) id <- as.character(id)

  # Check database
  if (!check_database(id = id, type = type)) {

    message("Database not found.")
    return(invisible(NULL))

  }

  return(.databases[[type]][[id]])

}
nicohuttmann/pOmics documentation built on Sept. 21, 2022, 9:28 a.m.