R/CHECKING-check_isotopic.R

Defines functions .check_isotopic

.check_isotopic <- function(isotopic) {
  
  if (length(isotopic) != 1L) {
    stop("Only one \"isotopic\" is possible.", 
         call. = FALSE)
  }
  
  if (!is.character(isotopic)) {
    stop("The provided isotopic is not \"any\", \"labeled\", or \"unlabeled\".", 
         call. = FALSE)
  }
  
  if (!any(tolower(isotopic) %in% c("any", "labeled", "unlabeled"))) {
    stop("The provided isotopic is not \"any\", \"labeled\", or \"unlabeled\".", 
         call. = FALSE)
  }
}
NIVANorge/chemspiderapi documentation built on Jan. 10, 2021, 10:12 a.m.