powered by
This function checks whether a vector is numeric.
validate_number(x)
A vector.
Returns a numeric vector (if valid) or NA (if not valid).
# NOT RUN { validate_number(c(1:5, "5", "", NA, "hello, world!")) # [1] 1 2 3 4 5 5 NA NA NA # }
Run the code above in your browser using DataLab