find.documented: Support for flat-format documentation

Description Usage Arguments Value Note Author(s) See Also

Description

find.documented locates functions that have flat-format documentation; the functions and their documentation can be separate, and are looked for in all the environments in pos, so that functions documented in one environment but existing in another will be found. find.docholder says where the documentation for one or more functions is actually stored. Both find.documented and find.docholder check two types of object for documentation: (i) functions with "doc" attributes, and (ii) character-mode objects whose name ends in ".doc"

Usage

1
2
3
find.documented( pos=1, doctype=c( "Rd", "casual", "own", "any"),
  only.real.objects=TRUE)
find.docholder( what, pos=find( what[1]))

Arguments

pos

search path position(s), numeric or character. In find.documented, any length. In find.docholder, only pos[1] will be used; it defaults to where the first element of what is found.

doctype

Defaults to "Rd". If supplied, it is partially matched against the choices in Usage. "Rd" functions are named in the alias list at the start of (i) any doc attribute of a function, and (ii) any text object whose name ends with ".doc", that exist in pos (see doc2Rd). "casual" functions have their own doc attribute and will be found by the replacement of help; note that the doc attribute can be just a reference to another documented function, of mode "list" as described in dochelp. "own" functions (a subset of "casual") have their own character-mode doc attribute, and are suitable for doc2Rd. "any" combines casual and Rd.

only.real.objects

If TRUE, only return names of things that exist somewhere in the pos environments. FALSE means that other things such as the name of helpfiles might be returned, too.

what

names of objects whose documentation you're trying to find.

Value

find.documented

Character vector of function names.

find.docholder

list whose names are what; element i is a character vector showing which objects hold documentation for what[i]. Normally you'd expect either 0 or 1 entries in the character vector; more than 1 would imply duplication.

Note

doctype="Rd" looks for the alias names, i.e. the first word of all lines occurring before the first blank line. This may include non-existent objects, but these are checked for and removed.

Start informal documentation (i.e. not intended for doc2Rd) with a blank line to avoid confusion.

Author(s)

Mark Bravington

See Also

flatdoc, doc2Rd, dochelp


mvbutils documentation built on May 2, 2019, 8:32 a.m.