Skip to contents

This is used as the interface between S7 and R's other OO systems, allowing you to use S7 classes and methods with base types, informal S3 classes, and formal S4 classes.

Usage

as_class(x, arg = deparse(substitute(x)))

Arguments

x

A class specification. One of the following:

arg

Argument name used when generating errors.

Value

A standardised class: either NULL, an S7 class, an S7 union, as new_S3_class, or a S4 class.

Examples

as_class(class_logical)
#> <S7_base_class>: <logical>
as_class(new_S3_class("factor"))
#> <S7_S3_class>: S3<factor>