R/db_path.R

Defines functions db_path

Documented in db_path

#' database path
#' @export
#' @param db (character) db name. one of: itis, tpl, col, gbif,
#' ncbi, wikidata, wfo. required
db_path <- function(db) {
  file <- switch(
    db,
    itis = "ITIS.sqlite",
    tpl = "plantlist.sqlite",
    col = "col.sqlite",
    gbif = "gbif.sqlite",
    ncbi = "NCBI.sql",
    wikidata = "wikidata.sqlite",
    wfo = "wfo.sqlite",
    stop("must be one of itis, tpl, col, gbif, ncbi, wikidata, wfo",
      call. = FALSE)
  )
  file.path(tdb_cache$cache_path_get(), file)
}
ropenscilabs/taxizedb documentation built on May 4, 2023, 7:05 a.m.