Learn R Programming

mvbutils (version 2.2.0)

add.flatdoc.to: Skeletal flat-format documentation

Description

Adds skeleton flat-format documentation to a function, suitable for conversion to Rd-format using doc2Rd. The result should pass RCMD CHECK (but won't be much use until you actually write the documentation!).

Usage

# See *Examples* for practical usage
add.flatdoc.to(x = get(char.x), char.x = NULL)

Arguments

x
unquoted function name
char.x
function name as character string

Value

  • A function with attribute docattr containing the flat-format documentation.

Details

You don't have to use Rd-compatible. You can write documentation that's as free-form as you wish, and there's no need to use add.flatdoc.to to do it-- you can write the doco directly in your text editor provided that you can source the resultant melange OK (see fixr). I find add.flatdoc.to useful, though, because I can never remember the headings or mild layout conventions of doc2Rd and Rd-format itself.

See Also

flatdoc, fixr, doc2Rd

Examples

Run this code
myfun <- function( ...) ...
myfun <- add.flatdoc.to( myfun)
# 'fixr( myfun)' will now allow editing of code & doco together

Run the code above in your browser using DataLab