[Rd] abs, dots and an S4 method.

Sven E. Templer sven.templer at gmail.com
Mon Aug 4 16:22:49 CEST 2014


Hello,

using the primitive abs(x) does not allow more than just the 'x'
argument in an S4 method, e.g. abs(x, arg2), since there is no '...'
as in trunc(x, ...).

To add a ... argument to abs(x), is it sufficient to change the arity
in src/main/names.c for abs as in trunc to a value of '-1'? So it
allows any number of arguments, not only 1? Or do I miss something
about it?

I found no clue checking the src/main/arithmetic.c do_abs and
do_trunc, or as proposed in R internals the do_switch in
src/main/builtin.c.

It would be very nice to have an abs S4 method, so to have the dots in there.

Thank you!
Sven.



More information about the R-devel mailing list