makeS3Obj {BBmisc}R Documentation

Simple constructor for S3 objects based on lists.

Description

Simple wrapper for as.list and setClasses.

Usage

makeS3Obj(classes, ...)

Arguments

classes

[character]
Class(es) for constructed object.

...

[any]
Key-value pairs for class members.

Value

Object.

Examples

makeS3Obj("car", speed=100, color="red")
## $speed
## [1] 100
## 
## $color
## [1] "red"
## 
## attr(,"class")
## [1] "car"

[Package BBmisc version 1.7 Index]