is_r6_instance: Checks if the passed entity is an instance of a given R6...

View source: R/r6.R

is_r6_instanceR Documentation

Checks if the passed entity is an instance of a given R6 class name.

Description

Checks if the passed entity is an instance of a given R6 class name.

Usage

is_r6_instance(value, class_name, allow_null = FALSE)

Arguments

value

the value to check

class_name

The name of the class

allow_null

If TRUE, allow the value to be NULL. If FALSE (default) do not accept NULL.

Examples

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

## End(Not run)


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