Learn R Programming

S7 (version 0.1.1)

as_class: Standard class specifications

Description

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)))

Value

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

Arguments

x

A class specification. One of the following:

  • An S7 class (created by new_class()).

  • An S7 union (created by new_union()).

  • An S3 class (created by new_S3_class()).

  • An S4 class (created by methods::getClass() or methods::new()).

  • A base class, like class_logical, class_integer, or class_double.

  • A "special", either class_missing or class_any.

arg

Argument name used when generating errors.

Examples

Run this code
as_class(class_logical)
as_class(new_S3_class("factor"))

Run the code above in your browser using DataLab