Learn R Programming

ehelp (version 1.1.1)

ehelp: Enhanced-Help Function: ehelp() This function displays docstring style comments used as help liners for user defined functions.

Description

Enhanced-Help Function: ehelp() This function displays docstring style comments used as help liners for user defined functions.

Usage

ehelp(
  fun,
  fn.name = as.character(substitute(fun)),
  coloring = FALSE,
  output = "none"
)

Arguments

fun

function name of an user-defined function

coloring

a Boolean flag indicating whether to use colors for displaying messages

output

specify if the documentation generated by the ehelp() will be saved in a file, possible values are "txt" (for help only), "TXT" (for help and full fn body) or "none" (default, for in screen display only)

fn

name of the function (string)

Examples

Run this code
# NOT RUN {
myTestFn <- function(x,y,z,t=0) {
#'
#' This is just an example of a dummy fn
#'
#'
#' @email myemail@somewhere.org
#' @author author
#
#
#' @demo
#' @examples myTestFn(x0,y0,z0)
}

ehelp(myTestFn)

## this requires the "crayon" package to work
ehelp(myTestFn, coloring=TRUE)

## generation of documentation for a fn in different formats
## by indicating a particular format, ehelp will save in a file
## the corresponding documentation of the selected fn
## Valid formats are:
## 		txt (plain-text), ascii (text with ESC-codes for coloring),
## 		latex, html, markdown
## Additionally, capitalized versions of these formats, will also include
## the listing of the fn

# }
# NOT RUN {
ehelp(myTestFn, output="latex")
ehelp(myTestFn, output="TXT")
ehelp(myTestFn, coloring=TRUE, output="HTML")
ehelp(myTestFn, coloring=TRUE, output="ASCII")
ehelp(myTestFn, coloring=TRUE, output="markdown")
# }

Run the code above in your browser using DataLab