is_class: Is class

View source: R/is-class.r

is_classR Documentation

Is class

Description

Tests if an object is of a given class

Usage

  is_class(x, name = NULL)

Arguments

x

an R object

name

string giving the class to be tested

Examples

is_class("test_me", "character") # TRUE
is_class(1:10, "numeric") # TRUE

y = 'hello'
class(y) = "hello"
is_class(y, 'hello')

tester documentation built on May 29, 2024, 7:33 a.m.