check_var_class: Variable Class Test

Description Usage Arguments Value Examples

Description

Tests if a variable of a certain class and returns an error message if not

Usage

1
check_var_class(var, class_method, class_name, error_message = NULL)

Arguments

var

Object: an object for class test

class_method

Function vector: class test function, e.g., is.numeric, is.logical and etc.

class_name

Character: name of the class

error_message

Character: user-defined error message

Value

Error message if test fails

Examples

1
2
obj <- 1:10
check_var_class(obj, is.numeric, 'numeric')

statech/CommonPlots documentation built on May 6, 2019, 1:32 a.m.