Learn R Programming

mvbutils (version 2.2.0)

find.documented: Support for flat-format documentation

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

find.documented( pos=1, doctype=c( "Rd", "casual", "own", "any"),
  only.real.objects=TRUE)
find.docholder( what, pos=find( funs[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 funs 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 any doc attribute of a function in pos (see doc2
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.documentedCharacter vector of function names.
  • find.docholderlist 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.

See Also

flatdoc, doc2Rd, dochelp

Examples

Run this code
# First create some flatdoc documentation in .GlobalEnv...
# ... by unpacking the helpfile for operator defns in mvbutils
some.doc <- help2flatdoc( "mvbutils-operators",
  attr( as.environment( "package:mvbutils"), "path"))
find.documented( list( .GlobalEnv, asNamespace( "mvbutils")))
# ... should see lots of '\%...\%'-type operators

Run the code above in your browser using DataLab