is_s4_instance: Checks if the passed entity is an S4 instance of a specified...

View source: R/s4.R

is_s4_instanceR Documentation

Checks if the passed entity is an S4 instance of a specified class.

Description

Checks if the passed entity is an S4 instance of a specified class.

Usage

is_s4_instance(value, class_name, allow_null = FALSE)

Arguments

value

the value to check

class_name

the name of the class, as a string.

allow_null

if true, accept a value that is NULL.

Examples

## Not run: 
# For assertion
assertthat::assert_that(
  qscheck::is_s4_instance(value, "MyClass")
  )
# For check
if (qscheck::is_s4_instance(value, "MyClass")) {}

## End(Not run)


AstraZeneca/qscheck documentation built on Nov. 1, 2023, 4:45 a.m.