R/rcatfish_version.R

Defines functions rcatfish_version

Documented in rcatfish_version

#' Retrieve the current version Number of the Eschmeyer's Catalog of Fishes Being Used
#' 
#' @description Returns the current version of Catalog of Fishes being used in the R session
#' @return Character Vector length of one with the Catalog of Fishes version
#' @examples
#' my.version <- rcatfish_version() 
#' @author Samuel R. Borstein
#' @references 
#' Fricke, R., Eschmeyer, W.N. & van der Laan, R. (Year Accessed). Eschmeyer's Catalog of Fishes: Genera, Species, References. https://researcharchive.calacademy.org/research/ichthyology/catalog/fishcatmain.asp.
#' @export

rcatfish_version<-function(){
  homeCOF <- readLines('https://researcharchive.calacademy.org/research/ichthyology/catalog/fishcatmain.asp',warn = FALSE)
  versionLine <- grep("version of",homeCOF)
  cof_version <- rvest::html_text(xml2::read_html(homeCOF[versionLine]))
  cof_version <- strsplit(cof_version," - |  ")[[1]][2]
  return(cof_version)
}

Try the rcatfish package in your browser

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

rcatfish documentation built on Feb. 3, 2026, 5:07 p.m.