demo
Demonstrations of Package Functionality

Description

Run files in a package's demo directory. These files often show how the functions in the package are expected to work together, or how to use some tricky functionality in the package.

Usage

demo(topic, package = NULL, lib.loc = NULL, character.only = FALSE, verbose = getOption("verbose", FALSE), echo = TRUE, ask = getOption("demo.ask", "default"))

Arguments

topic a name or a character string. Specifies the demo to demonstrate.
package a character string that indicates the package where topic is searched. If NULL, all loaded packages in the search list are used for topic searching.
lib.loc a character vector containing the names of library directories. If lib.loc is NULL, .libPaths() is used.
character.only a logical value.
  • If FALSE, an unquoted name is given as the topic argument. For example, topic=foo is treated as the character string "foo" and not as the value of the variable called foo.
  • If TRUE, the topic argument is evaluated as arguments usually are. For example, topic=foo is treated as the value of the variable foo.
If a literal string is given, for example: topic="foo", the value of character.only makes no difference.

verbose a logical value, passed to find.package (where, if a package is found in two library directories, the first package found is used).
  • If verbose is TRUE, a warning message is displayed.
  • If verbose is FALSE (the default), no warning message is displayed.
echo a logical value. If TRUE (the default), each expression is printed, along with a prompt, before it is evaluated.
ask a logical value or the string "default".
  • If TRUE, displays a prompt to press the return key before the demo is run.
  • If "default", then use the value of the echo argument.
  • If options("demo.ask") is set, then that value is used as the default value.
Value
A packageIQR is a matrix with extra attributes that print.packageIQR uses to format it to render a good display.
See Also
source, help.
Examples
demo(package = "base") # should see "scoping" and its description
demo(scoping, package = "base") # run the "scoping" demo
Package utils version 6.1.1-7
Package Index