| Line 1... |
Line 1... |
| 1 |
% File src/library/utils/man/capture.output.Rd
|
1 |
% File src/library/utils/man/capture.output.Rd
|
| 2 |
% Part of the R package, https://www.R-project.org
|
2 |
% Part of the R package, https://www.R-project.org
|
| 3 |
% Copyright 1995-2015 R Core Team
|
3 |
% Copyright 1995-2019 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{capture.output}
|
6 |
\name{capture.output}
|
| 7 |
\alias{capture.output}
|
7 |
\alias{capture.output}
|
| 8 |
\title{Send Output to a Character String or File}
|
8 |
\title{Send Output to a Character String or File}
|
| 9 |
\description{
|
9 |
\description{
|
| 10 |
Evaluates its arguments with the output being returned as a character
|
10 |
Evaluates its arguments with the output being returned as a character
|
| 11 |
string or sent to a file. Related to \code{\link{sink}} in the same
|
11 |
string or sent to a file. Related to \code{\link{sink}} similarly to how
|
| 12 |
way that \code{\link{with}} is related to \code{\link{attach}}.
|
12 |
\code{\link{with}} is related to \code{\link{attach}}.
|
| 13 |
}
|
13 |
}
|
| 14 |
\usage{
|
14 |
\usage{
|
| 15 |
capture.output(\dots, file = NULL, append = FALSE,
|
15 |
capture.output(\dots, file = NULL, append = FALSE,
|
| 16 |
type = c("output", "message"), split = FALSE)
|
16 |
type = c("output", "message"), split = FALSE)
|
| 17 |
}
|
17 |
}
|
| Line 23... |
Line 23... |
| 23 |
\item{append}{logical. If \code{file} a file name or unopened
|
23 |
\item{append}{logical. If \code{file} a file name or unopened
|
| 24 |
connection, append or overwrite?}
|
24 |
connection, append or overwrite?}
|
| 25 |
\item{type, split}{are passed to \code{\link{sink}()}, see there.}
|
25 |
\item{type, split}{are passed to \code{\link{sink}()}, see there.}
|
| 26 |
}
|
26 |
}
|
| 27 |
\details{
|
27 |
\details{
|
| - |
|
28 |
It works via \code{\link{sink}(<file connection>)} and hence the \R code
|
| - |
|
29 |
in \code{dots} must \emph{not} interfere with the connection (e.g., by
|
| - |
|
30 |
calling \code{\link{closeAllConnections}()}).
|
| - |
|
31 |
|
| 28 |
An attempt is made to write output as far as possible to \code{file}
|
32 |
An attempt is made to write output as far as possible to \code{file}
|
| 29 |
if there is an error in evaluating the expressions, but for
|
33 |
if there is an error in evaluating the expressions, but for
|
| 30 |
\code{file = NULL} all output will be lost.
|
34 |
\code{file = NULL} all output will be lost.
|
| 31 |
|
35 |
|
| 32 |
Messages sent to \code{\link{stderr}()} (including those from
|
36 |
Messages sent to \code{\link{stderr}()} (including those from
|