0

Using "roxygen2" I use @family to group together a bunch of S3 generic functions (each with some methods). In generated Rd files the See Also sections contains links not only to generic functions, but also to all defined methods.

Is there any way to control this behavior so that no links to methods are created?

See my package developed here https://github.com/mbojan/isnar. For example see coleman.R https://github.com/mbojan/isnar/blob/master/R/coleman.R and assort.R https://github.com/mbojan/isnar/blob/master/R/assort.R, and the Rd files that the generate in the man directory.

As you will see, the generic functions (e.g. coleman) and its methods (e.g. coleman.igraph, coleman.table, etc.) are documented in the same file (using @rdname). One way to dodge the problem would be to split documentation into separate files for generic and individual methods etc. and put @family only in the file with generic function. However, I really do not want to do that because I want to keep the source code of generic and its methods in the same file, and have all of them documented in the same Rd file.

Michał
  • 2,755
  • 1
  • 17
  • 20
  • You should use the `@family` only for those functions that you want to have links for. In other words, don't use `@family` for your methods as well. Please post an extract of your roxygen statements so we can see how you do this at the moment. – Andrie Aug 22 '14 at 08:28
  • That was my intention. It seems though that `@family` pulls all functions defined in a file instead of working a bit like `@export` which, I think, applies only to the function defined below it. I will include some snippets ASAP. – Michał Aug 22 '14 at 21:00
  • 1
    I think your problem happens because you want to have all the methods in the same Rd file. My experience is that `@family` works analogous to `@export`, as you suggest. But it is likely that this has the effect of documenting all functions in the same Rd file, as you experience. My suspicion is that in this case you can't have your cake and eat it. My suggestion would be to have the generic in a separate Rd from its methods. But keep the source in the same file. – Andrie Aug 23 '14 at 09:07
  • I guess I'd rather get rid of `@family` and put in the links by hand... I casual look at "roxygen2" sources seem to suggest that `roxygenise()` pulls all `\alias`es that are to be put into the particular Rd file and creates links for all of them in other Rd files of the same "family". – Michał Aug 23 '14 at 21:10
  • 1
    @Andrie, I guess your comment qualifies as an answer. – Michał Aug 23 '14 at 21:14

0 Answers0