Actual question
Avoiding Rd File Name Conflicts When
- S4 generic and its method need not be defined in one package (a package containing (some)) the custom method (s) depends on a package containing a common one) and
- using
roxygenize() from the roxygen2 package to create real Rd files?
I'm not sure if this is a roxygen2 problem or a general problem when the general one and their methods are scattered across packages (which IMHO as a whole is definitely a realistic scenario to use if you follow a modular programming style).
What is the recommended way to deal with these situations?
Illustration
In pkga package
Suppose that in the pkga package you defined the general foo method and that you provided the corresponding roxygen code that roxygenize() chooses to create the Rd file:
When roxygenizing() your package, a file called foo-methods.Rd is created in the man subdirectory, which serves as the Rd reference file for all methods that can be created for this generic method. So far, so good. If all the methods of this pedigree are also part of your package, all is well. For example, this roadcode will add documentation to foo-methods.Rd for the ANY method foo :
However, if the pkga package provides a common package for foo and you decide in some other package (say pkgb ) to add a foo method for x of the character class, then the R CMD check will tell you that there is a name clash regarding the Rd and / or file names aliases (since the Rd foo-methods.Rd file already exists in the pkga file):
In pkgb package
To be more precise, this is an error that was sent / written to 00install.out
Error : Q:/pkgb/man/foo-methods.Rd: Sections \title, and \name must exist and be unique in Rd files ERROR: installing Rd objects failed for package 'pkgb'
Due dilligence
I tried changing the values for @rdname and @aliases to foo_pkgb* (instead of foo* ), but \title and \name are still set to foo when rogening and therefore the error remains. Any ideas besides manually editing the Rd files generated by roxygenize() ?
EDIT 2012-12-01
In the light of the beginning of generosity, the real question may get a slightly wider taste:
How can we implement some “inter-package” checking for Rd files and / or how can we consolidate S4 help files scattered across packages into a single Rd file to represent a single source link to an end user?
generics r package s4 oxygen2
Rappster Oct 30 '12 at 11:20 2012-10-30 11:20
source share