prompt
Generate a Skeleton Documentation File for an Object
Description
Generate a skeleton documentation file for a function or a data object.
Usage
prompt(object, filename = NULL, name = NULL, ...)
## Default S3 method:
prompt(object, filename = NULL, name = NULL, force.function = FALSE, ...)
## S3 method for class 'function':
prompt(object, filename = NULL, name = NULL, ...)
## S3 method for class 'data.frame':
prompt(object, filename = NULL, name = NULL, ...)
promptData(object, filename = NULL, name = NULL)
Arguments
object |
a function or a data object to be documented (not a character string naming the object).
If name is supplied, then object does not have to be supplied. Its
default value is get(name).
For promptData, the object argument must be supplied.
|
filename |
a character string specifying the filename for the resulting documentation.
By default, it is <name>.Rd. The special value NA specifies
do not write a file; instead, return the character strings that would have
been written to the file.
|
name |
a character string giving the name of the object
to be documented. If object is an unquoted name, objectname, or an expression of
the form pkgName::objectName,
name does not have to be specified. Its value is "objectName".
|
Details
When object is not a function, prompt calls promptData, so there is
no need to call promptData directly.
You must provide at least the title and description sections of the skeleton help
file for it to compile.
The help file is in RD format, which is described in Writing R Extensions,
a manual included with the R system. The format has certain resembances to LaTeX.
If you put the RD files in the man directory of a source package, the RD files
are compiled when the package is installed using the INSTALL command.
Value
If filename = NA, returns a list representing the shell of a help file,
with each component containing the text for a section of the help file.
Otherwise it returns its filename argument.
See Also
Examples
## Not run:
prompt(objects)
promptData(datasets::trees)
# Look at the files uspop.Rd and trees.Rd with a text editor
# unlink(c("objects.Rd", "trees.Rd"))
## End(Not run)