The R Project SVN R

Rev

Rev 68948 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68948 Rev 82038
Line 11... Line 11...
11
  \R scripts.  \code{demo()} gives the list of available topics.
11
  \R scripts.  \code{demo()} gives the list of available topics.
12
}
12
}
13
\usage{
13
\usage{
14
demo(topic, package = NULL, lib.loc = NULL,
14
demo(topic, package = NULL, lib.loc = NULL,
15
     character.only = FALSE, verbose = getOption("verbose"),
15
     character.only = FALSE, verbose = getOption("verbose"),
-
 
16
     type = c("console", "html"), echo = TRUE,
16
     echo = TRUE, ask = getOption("demo.ask"),
17
     ask = getOption("demo.ask"),
17
     encoding = getOption("encoding"))
18
     encoding = getOption("encoding"))
18
}
19
}
19
\arguments{
20
\arguments{
20
  \item{topic}{the topic which should be demonstrated, given as a
21
  \item{topic}{the topic which should be demonstrated, given as a
21
    \link{name} or literal character string, or a character string,
22
    \link{name} or literal character string, or a character string,
Line 31... Line 32...
31
    packages are searched before the libraries.}
32
    packages are searched before the libraries.}
32
  \item{character.only}{logical; if \code{TRUE}, use \code{topic} as
33
  \item{character.only}{logical; if \code{TRUE}, use \code{topic} as
33
    character string.}
34
    character string.}
34
  \item{verbose}{a logical.  If \code{TRUE}, additional diagnostics are
35
  \item{verbose}{a logical.  If \code{TRUE}, additional diagnostics are
35
    printed.}
36
    printed.}
-
 
37
  \item{type}{character: whether to show output in the console or a
-
 
38
    browser (using the dynamic help system). The latter is honored only
-
 
39
    in interactive sessions and if the \code{\link[knitr]{knitr}}
-
 
40
    package is installed. Several other arguments are silently ignored
-
 
41
    in that case, including \code{lib.loc}.}
36
  \item{echo}{a logical.  If \code{TRUE}, show the \R input when sourcing.}
42
  \item{echo}{a logical.  If \code{TRUE}, show the \R input when sourcing.}
37
  \item{ask}{a logical (or \code{"default"}) indicating if
43
  \item{ask}{a logical (or \code{"default"}) indicating if
38
    \code{\link{devAskNewPage}(ask = TRUE)} should be called before
44
    \code{\link{devAskNewPage}(ask = TRUE)} should be called before
39
    graphical output happens from the demo code.  The value
45
    graphical output happens from the demo code.  The value
40
    \code{"default"} (the factory-fresh default) means to ask if
46
    \code{"default"} (the factory-fresh default) means to ask if
Line 45... Line 51...
45
    user is asked to press RETURN to start.}
51
    user is asked to press RETURN to start.}
46
  \item{encoding}{See \code{\link{source}}.  If the package has a
52
  \item{encoding}{See \code{\link{source}}.  If the package has a
47
    declared encoding, that takes preference.}
53
    declared encoding, that takes preference.}
48
}
54
}
49
\details{
55
\details{
50
  If no topics are given, \code{demo} lists the available demos.  The
56
  If no topics are given, \code{demo} lists the available demos.  For
51
  corresponding information is returned in an object of class
57
  \code{type = "console"}, the corresponding information is returned in
52
  \code{"packageIQR"}.
58
  an object of class \code{"packageIQR"}.
53
}
59
}
54
\seealso{
60
\seealso{
55
  \code{\link{source}} and \code{\link{devAskNewPage}} which
61
  \code{\link{source}} and \code{\link{devAskNewPage}} which
56
are called by \code{demo}.
62
  are called by \code{demo}. \code{\link{example}} to run code
-
 
63
  in the Examples section of help pages.
57
}
64
}
58
 
65
 
59
\examples{
66
\examples{
60
demo() # for attached packages
67
demo() # for attached packages
61
 
68