Learn R Programming

gWidgets (version 0.0-53)

ghelp: Widget to interface with help pages

Description

A widget to interface with the help pages and that widget placed in a browser. The widget is a notebook capable of showing several pages at once.

Usage

ghelp(topic = NULL, package = NULL, container = NULL, ..., toolkit = guiToolkit())
ghelpbrowser(title = "Help browser", maxTerms=100, width=1000, 
height=600, ..., toolkit = guiToolkit())

Arguments

topic
Help topic
package
Which package to look for topic in
container
Optional container to attach widget to
title
Title of help browser
maxTerms
Maximum number of search responses
width
Width of browser window in pixels
height
Height of browser window in pixels
...
Passed to add method of container
toolkit
Which GUI toolkit to use

Details

The ghelp widget is a notebook to hold help pages. One can add pages with add. The help page is specified with a character vector or list. The first component is the topic, the second and optional package designation. The svalue method returns a list with topic and package. The dispose method will remove the current page. For toolkits that support them, closebuttons appear on the etabs

The ghelpbrowser constructor produces a stand alone GUI for browsing help pages. Unlike other gWidgets constructors, this has no container argument.

See Also

The helpr package provides a much better interface to R's help pages.

Examples

Run this code
w <- gwindow("Help browser", visible=FALSE)
  g <- ggroup(horizontal=FALSE, container=w)
  g1 <- ggroup(container=g)
  addSpring(g1)
  glabel("Help on:", container=g1)
  e <- gedit("", container=g1)
  helpWidget <- ghelp(container = g, expand=TRUE)
  addHandlerChanged(e, handler=function(h,...) {
     add(helpWidget, svalue(h$obj))
  })
  visible(w) <- TRUE
  ## add others
  add(helpWidget,"base:::mean")
  add(helpWidget, list(topic="mean", package="base"))
  add(helpWidget, "boxplot")

Run the code above in your browser using DataLab