is_numeric_vector: Check if an object is a numeric vector

View source: R/is_functions.R

is_numeric_vectorR Documentation

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)

Arguments

x

An object to check.

Value

A logical value indicating whether x is a numeric vector.

Examples

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
}


assertions documentation built on June 7, 2023, 6:03 p.m.