Learn R Programming

swirl (version 2.2.0)

var_is_a: Returns TRUE if a variable of the given name exists in the global environment and is of the given class.

Description

Returns TRUE if a variable of the given name exists in the global environment and is of the given class.

Usage

var_is_a(class, var_name)

Arguments

class
expected class which the given variable
var_name
name of the variable

Value

  • TRUE or FALSE

Examples

Run this code
# Test that a variable named "x" in the global environmentis numeric.
var_is_a('numeric', 'x')

Run the code above in your browser using DataLab