Dear all, I'm trying to understand the S4 way of object-oriented programming, but I still can't grasp completely what R is doing. I have a class definition for a class called PM10Meteo, and I set a initializer function. next, I include a show method and a print method as shown below.
setClass( Class="PM10Meteo",...) # end setClass setMethod ("initialize",signature="PM10Meteo",...) # end setMethod ######## # Show Method # setMethod("show","PM10Meteo", function(object){ ... } # end function ) # end show method ####### # Print Method # setMethod("print","PM10Meteo", function(x,n=400,station=F,values=T,meteo=T,...){ ... } ) # end print method Now when I run the complete class definition file, neither the method "initialize" nor the method "show" occur in the list given by ls(). On the other hand, the method "print" does! So when I use rm(list=ls()) I still have the "initialize" and "show" method, but the "print" method is gone. Am I forgetting something somewhere? It's rather inconvenient to have to run the definition files every time I want to clear the memory. Cheers Joris -- Joris Meys Statistical Consultant Ghent University Faculty of Bioscience Engineering Department of Applied mathematics, biometrics and process control Coupure Links 653 B-9000 Gent tel : +32 9 264 59 87 joris.m...@ugent.be ------------------------------- Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php [[alternative HTML version deleted]] ______________________________________________ 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.