mvbutils (version 2.8.232)

help2flatdoc: Convert help files to flatdoc format.


Converts a vanilla R help file (as shown in the internal pager) to plain-text format. The output conventions are those in doc2Rd, so the output can be turned into Rd-format by running it through doc2Rd. This function is useful if you have existing Rd-format documentation and want to try out the flatdoc system of integrated code and documentation. Revised Nov 2017: now pretty good, but not perfect; see Details.


help2flatdoc(, pkg=NULL, text=NULL, aliases=NULL)


function name (a character string)


name of package


plain-text help


normally leave this empty--- see Details.


The package containing must be loaded first. If you write documentation using flatdoc, prepare the package with pre.install, build it with RCMD BUILD or INSTALL, and run help2flatdoc on the result, you should largely recover your original flat-format documentation. Some exceptions:

  • Nesting in lists is ignored.

  • Numbered lists won't convert back correctly (Nov 2017), but the problem there is in doc2Rd.

  • Link-triggering phrases (i.e. that will be picked up by doc2Rd, such as "see <blah>") aren't explicitly created-- probably, links could be automated better via an argument to doc2Rd.

Aliases (i.e. if this doco can be found by help under several different names) are deduced from function calls in the Usage section, in addition to anything supplied specifically in the alias argument. The latter is really just meant for internal use by unpackage.

See Also



Run this code
cd.doc <- help2flatdoc( "cd", "mvbutils")
print( cd.doc)
cd.Rd <- doc2Rd( cd.doc)
# }

Run the code above in your browser using DataCamp Workspace