Learn R Programming

assertions (version 0.1.0)

is_numeric_vector: Check if an object is a numeric vector

Description

This function checks if an object is a numeric vector in R.

Usage

is_numeric_vector(x)

Value

A logical value indicating whether x is a numeric vector.

Arguments

x

An object to check.

Examples

Run this code
if(interactive()){
is_numeric_vector(c(1, 2, 3)) # TRUE
is_numeric_vector(list(1, 2, 3)) # FALSE
is_numeric_vector(1:5) # TRUE
is_numeric_vector("hello") # FALSE
is_numeric_vector(list(1, 2, "a")) # FALSE
}

Run the code above in your browser using DataLab