Having difficulty following the examples in John Chambers paper "Classes
and Methods in the S Language", dated 9 August 2001. See error below in
whatis (matrix (0,2,3)). Thanks for help.
library (methods)
whatis <- function (object) paste ("an object of class",
+ data.class (object))
setMethod ("whatis", "vector", function (object)
+ paste (data.class (object), "vector of length",
+ length (object)))
Creating a new generic function for "whatis" in package
.GlobalEnv
[1] "whatis"