Tutorial by Examples

S3

The S3 object system is a very simple OO system in R. Every object has an S3 class. It can be get (got?) with the function class. > class(3) [1] "numeric" It can also be set with the function class: > bicycle <- 2 > class(bicycle) <- 'vehicle' > class(bicycle) ...

Page 1 of 1