[R] Getting Rd pages right for redefined S3 generic

S Ellison S.Ellison at lgc.co.uk
Fri Dec 18 05:08:07 CET 2009


I'm writing a package, and would appreciate advice on controlling the
help documentation cross-references for a redefined generic.

I wanted to define a cbind equivalent for an object that mostly behaves
like a data frame. base::cbind dispatches to a data frame method if
_any_ parameter is a data frame, so I defined a new S3 cbind and
cbind.default to handle dispatch on first object only. Though I confess
that redefining cbind leaves me a tad nervous, that all works OK so far.

However, R cmd tells me (rightly) that I haven't documented the generic
and new default. But I don't want to; I want ?cbind to point to the base
package help pages, not to mine.

Assuming that's not unwise (?), what do I have to do to tell R cmd that
it should not look for Rd docs for cbind and cbind.default in my package
whilst still having my generic handle dispatch correctly?

It looks like one answer _might_ be not to export my redefined cbind  -
but will a local generic still work properly if it's not exported?
 
Steve Ellison


*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}




More information about the R-help mailing list