Greetings, I am using S4 classes and the code is organized by putting each class into a separate source file in a separate folder: In Folder base/base.R: defines class "base" and does setGeneric("showSelf", function(this) standardGeneric("showSelf") ) setMethod("showSelf", signature(this="base"), definition= function(this){ ... } ) For j=1,...,n: in derived_j/derived_j.R: defines class "derived_j" and does setMethod("showSelf", signature(this="derived_j"), definition= function(this){ ... } ) Finally in tests/tests.R we do source("../base/base.R") source("../derived_1/derived_1.R") source("../derived_2/derived_2.R") .... source("../derived_n/derived_n.R") now we check which methods "showSelf" are known at this point: showMethods("showSelf") and get >showMethods("showSelf") Function: showSelf (package .GlobalEnv) this="base" this="derived_n" The methods with signature this="derived_j", j<n are not known. Needless to say this makes the code useless. How can I remedy this evil? Many thanks, Michael Meyer [[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.