| Line 1... |
Line 1... |
| 1 |
% File src/library/utils/man/example.Rd
|
1 |
% File src/library/utils/man/example.Rd
|
| 2 |
% Part of the R package, http://www.R-project.org
|
2 |
% Part of the R package, http://www.R-project.org
|
| 3 |
% Copyright 1995-2014 R Core Team
|
3 |
% Copyright 1995-2015 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{example}
|
6 |
\name{example}
|
| 7 |
\alias{example}
|
7 |
\alias{example}
|
| 8 |
\title{Run an Examples Section from the Online Help}
|
8 |
\title{Run an Examples Section from the Online Help}
|
| 9 |
\description{
|
9 |
\description{
|
| 10 |
Run all the \R code from the \bold{Examples} part of \R's online help
|
10 |
Run all the \R code from the \bold{Examples} part of \R's online help
|
| 11 |
topic \code{topic} with possible exceptions \code{dontrun},
|
11 |
topic \code{topic} with possible exceptions \code{dontrun},
|
| 12 |
\code{dontshow}, and \code{dontcheck}, see \sQuote{Details} below.
|
12 |
\code{dontshow}, and \code{donttest}, see \sQuote{Details} below.
|
| 13 |
}
|
13 |
}
|
| 14 |
\usage{
|
14 |
\usage{
|
| 15 |
example(topic, package = NULL, lib.loc = NULL,
|
15 |
example(topic, package = NULL, lib.loc = NULL,
|
| 16 |
character.only = FALSE, give.lines = FALSE, local = FALSE,
|
16 |
character.only = FALSE, give.lines = FALSE, local = FALSE,
|
| 17 |
echo = TRUE, verbose = getOption("verbose"),
|
17 |
echo = TRUE, verbose = getOption("verbose"),
|
| 18 |
setRNG = FALSE, ask = getOption("example.ask"),
|
18 |
setRNG = FALSE, ask = getOption("example.ask"),
|
| 19 |
prompt.prefix = abbreviate(topic, 6),
|
19 |
prompt.prefix = abbreviate(topic, 6),
|
| 20 |
run.dontrun = FALSE, run.dontcheck = interactive())
|
20 |
run.dontrun = FALSE, run.donttest = interactive())
|
| 21 |
}
|
21 |
}
|
| 22 |
\arguments{
|
22 |
\arguments{
|
| 23 |
\item{topic}{name or literal character string: the online
|
23 |
\item{topic}{name or literal character string: the online
|
| 24 |
\code{\link{help}} topic the examples of which should be run.}
|
24 |
\code{\link{help}} topic the examples of which should be run.}
|
| 25 |
\item{package}{a character vector giving the package names to look
|
25 |
\item{package}{a character vector giving the package names to look
|
| Line 54... |
Line 54... |
| 54 |
device and to any devices opened by the example code.}
|
54 |
device and to any devices opened by the example code.}
|
| 55 |
\item{prompt.prefix}{character; prefixes the prompt to be used if
|
55 |
\item{prompt.prefix}{character; prefixes the prompt to be used if
|
| 56 |
\code{echo = TRUE}.}
|
56 |
\code{echo = TRUE}.}
|
| 57 |
\item{run.dontrun}{logical indicating that \verb{\dontrun}
|
57 |
\item{run.dontrun}{logical indicating that \verb{\dontrun}
|
| 58 |
should be ignored.}
|
58 |
should be ignored.}
|
| 59 |
\item{run.dontcheck}{logical indicating that \verb{\dontcheck}
|
59 |
\item{run.donttest}{logical indicating that \verb{\donttest}
|
| 60 |
should be ignored.}
|
60 |
should be ignored.}
|
| 61 |
}
|
61 |
}
|
| 62 |
\value{
|
62 |
\value{
|
| 63 |
The value of the last evaluated expression, unless \code{give.lines}
|
63 |
The value of the last evaluated expression, unless \code{give.lines}
|
| 64 |
is true, where a \code{\link{character}} vector is returned.
|
64 |
is true, where a \code{\link{character}} vector is returned.
|
| Line 85... |
Line 85... |
| 85 |
\item{\code{dontrun}}{encloses code that should not be run.}
|
85 |
\item{\code{dontrun}}{encloses code that should not be run.}
|
| 86 |
\item{\code{dontshow}}{encloses code that is invisible on help
|
86 |
\item{\code{dontshow}}{encloses code that is invisible on help
|
| 87 |
pages, but will be run both by the package checking tools,
|
87 |
pages, but will be run both by the package checking tools,
|
| 88 |
and the \code{example()} function. This was previously
|
88 |
and the \code{example()} function. This was previously
|
| 89 |
\code{testonly}, and that form is still accepted.}
|
89 |
\code{testonly}, and that form is still accepted.}
|
| 90 |
\item{\code{dontcheck}}{encloses code that typically should be run,
|
90 |
\item{\code{donttest}}{encloses code that typically should be run,
|
| 91 |
but not during package checking. The default \code{run.dontcheck
|
91 |
but not during package checking. The default \code{run.donttest
|
| 92 |
= \link{interactive}()} leads \code{example()} use in other help
|
92 |
= \link{interactive}()} leads \code{example()} use in other help
|
| 93 |
page examples to skip \verb{\dontcheck} sections appropriately.}
|
93 |
page examples to skip \verb{\donttest} sections appropriately.}
|
| 94 |
}
|
94 |
}
|
| 95 |
}
|
95 |
}
|
| 96 |
\author{Martin Maechler and others}
|
96 |
\author{Martin Maechler and others}
|
| 97 |
\seealso{\code{\link{demo}}}
|
97 |
\seealso{\code{\link{demo}}}
|
| 98 |
\examples{
|
98 |
\examples{
|