Skip to content
Prev 14450 / 398502 Next

Classes in R

Two quick questions.

First, why doesn't using the matrix function actually set the class of the
resulting object to "matrix"?
$dim
 [1] 10 10

or should I be using?
$dim
[1] 10 10

$class
[1] "matrix"

Second, can somone please send me an example showing how inheritance works
in R?  The R Language Definition document isn't particularly clear on the
subject... i.e. NextMethod lacks a good example.

Cheers,
Randall

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._