tests/typeOfClass.R

message("TESTING: typeOfClass()...")

library("R.oo")

type <- typeOfClass(NULL)
print(type)
stopifnot(is.na(type))

type <- typeOfClass(Object)
print(type)
stopifnot(type == "S3-Object")

type <- typeOfClass("Object")
print(type)
stopifnot(type == "S3-Object")

library("methods")
type <- typeOfClass("data.frame")
print(type)
stopifnot(type == "S4")

clazz <- getClass("data.frame")
type <- typeOfClass(clazz)
print(type)
stopifnot(type == "S4")

type <- typeOfClass("Non-Existing-Class")
print(type)
stopifnot(is.na(type))

message("TESTING: typeOfClass()...DONE")

Try the R.oo package in your browser

Any scripts or data that you put into this service are public.

R.oo documentation built on Nov. 2, 2024, 1:07 a.m.