validate_number {capl}R Documentation

Check whether a vector is numeric.

Description

This function checks whether a vector is numeric.

Usage

validate_number(x)

Arguments

x

A vector.

Value

Returns a numeric vector (if valid) or NA (if not valid).

Examples

validate_number(c(1:5, "5", "", NA, "hello, world!"))

# [1]  1  2  3  4  5  5 NA NA NA


[Package capl version 1.42 Index]