s3_class: Compute the S3 class of an object

View source: R/s3_class.R

s3_classR Documentation

Compute the S3 class of an object

Description

Compared to class(), this always returns the class vector that is used for dispatch. This is most important for objects where the class attribute has not been set.

Usage

s3_class(x)

Arguments

x

A primitive type

Examples

s3_class(NULL)

s3_class(logical())
s3_class(integer())
s3_class(numeric())
s3_class(character())

s3_class(matrix())
s3_class(matrix(1))

s3_class(array())
s3_class(array(1))

hadley/S3 documentation built on Nov. 4, 2023, 1:27 a.m.