R/check_name_fishbase.R

Defines functions check_name_fishbase

Documented in check_name_fishbase

#' Returns error if name is incorrect
#'
#' This is a wrapper function to which will return an error (via
#' \code{\link[fishflux]{name_errors}}) if the provided species name is wrong.
#'
#' @param sp A character value containing the species name
#' 
#' @returns returns an error if the species name is wrong.
#' 
#' @keywords fish fishbase taxonomy
#' 
#' @examples
#' \dontrun{
#' library(fishflux)
#' check_name_fishbase("Lutjanus griseus")
#' }
#' 
#' @export
check_name_fishbase <- function(sp) {
  if (length(suppressMessages(name_errors(sp))) > 0) {
    stop("Species name is incorrect")
  }
}

Try the fishflux package in your browser

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

fishflux documentation built on May 6, 2022, 9:06 a.m.