On Thu, 12 Apr 2007, jiho.han wrote:

>
> Hi, R-experts
>
> I defined a new class of object, called "alpha", which is basically a
> data.frame. And (I think) I know how to create a method for "alpha", such as
> "summary.alpha", "plot.alpha". The problem is, when I try to access "alpha"
> object by usual data.frame method, it won't.
>
> For example, suppose X is an object of class "alpha". Then, the commands
> such as dim(X), X[1,1], none of these works.
>
> I want to know how to define a class so that when there is appropriate
> methods use it, but when there's not use the predetermined method for
> underlying object. Any comments would be appreciated. Thanks-

class(X) <- c("alpha", "data.frame")

is I think what you want.


-- 
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to