Learn R Programming

svMisc (version 0.9-60)

argsTip: Show function arguments in a human-readable way - get a call tip

Description

argsTip() displays function arguments in a better way than args() does. It is primarily intended for code tips in GUIs.

Usage

argsTip(name, only.args = FALSE, width = getOption("width"))
callTip(code, only.args = FALSE, location = FALSE, description = FALSE,
    methods = FALSE, width = getOption("width"))

Arguments

name
a string with the name of a function.
code
a fraction of R code ending with the name of a function, eventually followed by '('.
only.args
do we return only arguments of the function (arg1, arg2 = TRUE, ...), or the full call, like (myfun(arg1, arg2 = TRUE, ...)).
width
reformat the tip to fit that width, except if width = NULL.
location
if TRUE then the location (in which package the function resides) is appended to the calltip between square brackets.
description
if TRUE then a short description of the function is added to the callTip (in fact, the title of the corresponding help page, if it exists).
methods
if TRUE then a short message indicating if this is a generic function and that lists, in this case, available methods.

Value

  • A string with the calling syntax of the function, plus additional information, depending on the flag used. Note that methods can considerably slow down the execution, especially for generic functions that have many methods like print(), or summary!

concept

Graphical user interface (GUI) control, calltip

See Also

args, argsAnywhere

Examples

Run this code
argsTip("ls")
callTip("myvar <- lm(")

Run the code above in your browser using DataLab