Math.dreieck <- function(x, ...)
{
x[, 3] <- do.call(.Generic, list(x[, 3], ...))
x
}
It works well for example when I call log(object):
> object
UJ AJ Z
1 1 1 2.000000
2 1 2 2.718282
3 2 1 3.000000
> log(object)
UJ AJ Z
1 1 1 0.6931472
2 1 2 1.0000000
3 2 1 1.0986123
but the problem arises when I have additional arguments:
> trace(c("log", "Math.dreieck"))
> log(object, base = 2)
On entry: log(object, base = 2)
On entry: Math.dreieck(x)
On entry: log(c(2, 2.71828182845904,
3))
UJ AJ Z
1 1.442695 1.442695 1.000000
2 1.442695 2.885390 1.442695
3 2.885390 1.442695 1.584963
Moreover, the result's class is NULL (it was c("dreieck", "data.frame")
in log(object))
Can anybody tell me firstly why this happens, and secondly what would be
the right way of doing what I want? (I have also tried using NextMethod,
without much success.)
Many thanks in advance
Pierre Joyet
Baloise Insurance Company
Basle, Switzerland
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news