Learn R Programming

sloop (version 1.0.1)

s3_class: 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

Run this code
# NOT RUN {
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))
# }

Run the code above in your browser using DataLab