R/OBIS_imprecision.R

Defines functions OBIS_imprecisionrate

Documented in OBIS_imprecisionrate

#'Return the percentage of taxa occurrences unidentified to the finest taxa level (i.e. species)
#'
#' @param taxa A string.
#' @return the percentage of taxa occurrences on OBIS
#' @examples
#'\dontrun{
#'OBIS_imprecisionrate("Abra")
#'}
#'@export

OBIS_imprecisionrate <- function(taxa) {
  dd <- robis::occurrence(taxa)$species
  incomplete <- length(which(is.na(dd == TRUE)))
  imprecisionrate <- incomplete / length(dd)
  return(imprecisionrate)
}
SCAR/biotaxa documentation built on May 20, 2019, 3:05 p.m.