R/canbe.numeric.R

Defines functions canbe.numeric

canbe.numeric <- function(x){
    if (!is.character(x)) x <- as.character(x)
    u <- x[!is.na(x) & x!="NA"]
    test <- suppressWarnings(as.numeric(u))
    if (any(is.na(test)))
        FALSE
    else
        TRUE
}

Try the Publish package in your browser

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

Publish documentation built on Jan. 18, 2023, 1:08 a.m.