Hi guys I have a basic question about S4 stuff
Here is how I do it: setGenericVerif <- function(x,y){if(!isGeneric(x)){setGeneric(x,y)}else{}} # from the genolini intro to S4 # here is the class setClass("RiskBuckets", representation( ... xxx ... ) ) # here is the generic f. setGenericVerif("compute.Gaussian.probs.Cell", function(object, mu, sigma, ...) standardGeneric("compute.Gaussian.probs.Cell") ) # here is the method setMethod("compute.Gaussian.probs.Cell", "RiskBuckets", function(object, mu, sigma, ...) { ... xxx ... } } return(... xxx ...) } ) All that is run with the following: rm(list=ls()) # load the classes: source("../Objects/sourceAllObjects.r") # test the classes: source("test_RiskBuckets.r") If I run R and try the everything is fine. :-) However, is try TO RUN IT AGAIN (without closing R) I get a message: Fehler in eval.with.vis(expr, envir, enclos) : konnte Funktion "compute.Gaussian.probs.Cell" nicht finden (Sorry for the German.) The function is NOT FOUND anymore! How's that? Best regards Giuseppe Gabriel Cardi
Visit our website at http://www.ubs.com This message contains confidential information and is in...{{dropped:21}}
______________________________________________ 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.