Dear R community

I try to create a new operator to build a special sum of two CashFlows. (my  
S4 Class)

I tried the following but this is actually not what I want.

setGeneric("++",function(e1,e2)standardGeneric("++"))

setMethod("+",signature=list("CashFlow","CashFlow"),function(e1,e2){
print("+")
})
setMethod("++",signature=list("CashFlow","CashFlow"),function(e1,e2){
print("++")
})

The problem here is that this work but it treats "++" as a general  
function.. the call is "++"(e1,e2).
I'm looking for somthing like e3 <- e1 ++ e2

Thanks a lot for your help.
Best regards,
Roger

        [[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.

Reply via email to