On 17/12/2009 11:08 PM, S Ellison wrote:
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.

But then the documentation will be incorrect, since it mentions the non-standard handling of dataframes, which you've done away with.

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?

I would say that what you've done is unwise. I would rename the function to avoid future confusion, especially if you decide to export it. Even if it's for internal use only, won't you want a reminder in 2 years time that cbind(a,b) doesn't mean what the documentation says it means?

Duncan Murdoch

______________________________________________
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