bugfix_Rd2roxygen: Like Rd2roxygen, but fixing some bugs

bugfix_Rd2roxygenR Documentation

Like Rd2roxygen, but fixing some bugs

Description

Like package Rd2roxgyen (qv), for modding the R source in an existing source package to add Roxgyen comments (i.e., documentation and export instructions). Package Rd2roxgyen does most of the work, but it has a couple of bugs and I don't think they are likely to get fixed soon (one of them is "a feature").

This is called internally by pre.install, if "RoxygenNote" is found in the DESCRIPTION file, but can also be called manually.

Personally I don't like Roxygen— to me it seems a bad implementation of a reasonable idea (keep documentation tightly linked with code, and avoid markup complexity) for which there are better and simpler ways— but Others do. So this might help, especially if Others are collaborating with non-Roxygenites..

Usage

bugfix_Rd2roxygen( sourcedir, pkg = basename(sourcedir), nsinfo = NULL)

Arguments

sourcedir

folder containing the source package (so it should contain a "DESCRIPTION" file, a folder called "R", and so on)

pkg

name of the package, deduced from sourcedir if not supplied

nsinfo

info slurped from the NAMESPACE file (actually just about S3 methods, which Rd2roxygen inexplicably ignores). Used internally by pre.install for efficiency, but if you are calling this manually, you can leave it and the NAMESPACE file itself will be used

Value

Alters the file "<sourcedir>/R/<pkg>.R". Also, if there's a file "<sourcedir>/R/<pkg>-package.R", then a "Collate" field is added (or modified) to the DESCRIPTION file, to make sure that the package-source is collated last. This is a good idea, for reasons that I can no longer remember.


mvbutils documentation built on May 25, 2026, 5:09 p.m.