Sylvain Mareschal, Ph.D.
Bioinformatics engineer
October 26, 2014 at 16:20
promptRefClass()
promptRefClass.R (click to download)

Similarly to promptClass(), this function generates an help page skeleton for a Reference class, listing extended classes, fields and methods. It extracts method descriptions from the self-documentation mechanism enforced by R reference classes, to preserve documentations synchronized.

Usage
source("http://bioinformatics.ovsa.fr/files/promptRefClass.R")
promptRefClass(class, file=sprintf("%s-class.Rd", class))


Arguments
class : Single character value, the name of the reference class to document (must be defined in current environment).
file : Single character value, the name of the documentation file to produce.

Value
Returns nothing.

Example
setRefClass(
  Class = "dummy",
  fields = c(
    number = "numeric",
    string = "character"
  ),
  methods = list(
    print = function(digits=3) {
      "Print the object content.
      - digits : Single integer value, amount of significant digits to print"
      cat(.self$string, "=", signif(.self$number, digits), "\n")
    }
  )
)
promptRefClass("dummy")