testNumericCompatible: Test if a Variable is Inherently Numeric ('0.1' as numeric)

View source: R/Stringendo.R

testNumericCompatibleR Documentation

Test if a Variable is Inherently Numeric ('0.1' as numeric)

Description

This function checks if a given variable is inherently numeric. It returns TRUE if the variable can be converted to a numeric value without loss of information and is not inherently a character string, otherwise it returns FALSE.

Usage

testNumericCompatible(x)

Arguments

x

The variable to be tested. Default: NA.

Value

A logical value indicating whether the input is inherently numeric.

Examples

testNumericCompatible(0.1) # Should return TRUE
testNumericCompatible("0.1") # Should return TRUE
testNumericCompatible("apple") # Should return FALSE
testNumericCompatible("arma.0.1") # Should return FALSE

vertesy/Stringendo documentation built on Nov. 10, 2024, 4:35 a.m.