is.numeric()
function in R Language is used to check if the object passed to it as argument is of numeric type.
Syntax: is.numeric(x)
Parameters:
x: Object to be checked
Example 1:
is .numeric( 1 )
is .numeric( 1.5 )
is .numeric( - 1.5 )
|
Output:
[1] TRUE
[1] TRUE
[1] TRUE
Example 2:
x1 < - matrix(c( 1 : 9 ), 3 , 3 )
is .numeric(x1)
|
Output:
[1] TRUE