4

For example, I have a file foo.R with the contents:

#FILE: foo.R
foo <- function() "foo"
bar <- function() "bar"

This forms the R code for my package. I want to document both foo and bar in a single .Rd file: when the user enters help(foo) or help(bar), the result should be the same (to bring up the help page that documents both foo and bar). (Similarly, help(cos) and help(sin) result in identical behavior.)

Executing package.skeleton(name="pkg1", path="OUTDIR/", code_files="INDIR/foo.R") creates separate .Rd files for foo and bar in the "man" subdirectory.

How do I create a single .Rd file that documents both foo and bar, and that that help can find?

I am following Writing R Extensions, trying to create a very simple package without using any tools other than those that ship with a basic R installation (no Roxygen, for example), plus the system shell (e.g., bash or, in the present case, Windows command line, for executing e.g., R CMD build.)

Ana Nimbus
  • 635
  • 3
  • 16

0 Answers0