Dear all, I have defined my own class "myclass" using S3 class styles. A myclass objects is just a matrix with some attribute attached. When I subset my myclass the resulting matrix (or vector) doesn't have the attributes attached.
I would like to redefine the `[` function for myclass objects (it has to behave the same as the standard function but just attach the attributes to the subset). I have tried to define the method: `['.myclass <- function(X,... ) { etc...} but it doesn't work ( I realized after that `[` is a .Primitive). How can I define this method for my own class? Thanks a lot in advance for the help, Cheers, Luca ______________________________________________ R-help@r-project.org 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.