[R] Binary operators in packages and documentation?

Zhou Fang zhou.zfang at gmail.com
Thu Nov 26 05:23:59 CET 2009


Hi,

I'm trying to make a package defining a new (S3?) class. Part of this
involves a custom version of a binary operator. e.g. "*.foo", so I can
do obj.foo * bar, or things like that.

Now, I think to makes this work with a NAMESPACE, I can do

S3method("*", foo)

in the NAMESPACE file, right? The question I was wondering was what
the appropriate way to document this operator is. i.e. What should I
put in the \usage section, etc?

'Writing R Extensions' doesn't seem to see much about this, but maybe
I'm missing something obvious.

Thanks,

Zhou Fang




More information about the R-help mailing list