R/notANumber.bare.R

Defines functions notANumber

Documented in notANumber

#===== Source file: ../notANumber.r on 2021-06-02
#-----

notANumber <- function(x, result=c("logical", "values")) 
{
  if (!is.character(x))  stop("'x' is not a character vector")
  x[is.na(x) | x == ""] <- "0"
  xx <- suppressWarnings(as.numeric(x))   # Invalid strings will become NA
  result <- match.arg(result)
  if (result == "logical")  is.na(xx)  else  unique(x[is.na(xx)])
}

Try the tablesgg package in your browser

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

tablesgg documentation built on June 3, 2021, 1:06 a.m.