addS3Class: Add a S3 class to an object.

View source: R/addS3Class.R

addS3ClassR Documentation

Add a S3 class to an object.

Description

Add a S3 class as first class to an object.

Usage

addS3Class(x, class = NULL)

Arguments

x

The object to add class.

class

The class to add.

Details

addS3Class add a S3 class to an object

Value

The same object with the new class as first class

Author(s)

Marc Girondot marc.girondot@gmail.com

Examples

print.CF <- function(x) {cat("print.CF ", x)}
result <- "Je suis donc je pense"
result <- addS3Class(result, class="CF")
class(result)
print(result)
result <- addS3Class(result, class=c("ECF", "OCF"))
class(result)
print(result)

HelpersMG documentation built on Sept. 12, 2024, 9:35 a.m.