sinkplot.html
2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>R: Send textual R output to a graphics device</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>
<table width="100%" summary="page for sinkplot {gplots}"><tr><td>sinkplot {gplots}</td><td align="right">R Documentation</td></tr></table>
<h2>Send textual R output to a graphics device</h2>
<h3>Description</h3>
<p>
Divert R's standard text output to a graphics device.
</p>
<h3>Usage</h3>
<pre>
sinkplot(operation = c("start", "plot", "cancel"), ...)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>operation</code></td>
<td>
See below</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
Plot arguments. (Ignored unless <code>operation</code>="plot").</td></tr>
</table>
<h3>Details</h3>
<p>
This function allows the printed output of R commands to be captured
and displayed on a graphics device.
</p>
<p>
The capture process is started by calling
<code>sinkplot("start")</code>. Now R commands can be executed and all
printed output (except errors) will be captured. When the desired
text has been captured <code>sinkplot("plot")</code> can be called to
actually display the output. <code>sinkplot("cancel")</code> can be used to
abort the output capture without plotting.
</p>
<p>
The current implementation does not allow <code>sinkplot</code> to be nested.
</p>
<h3>Value</h3>
<p>
Invisibly returns a character vector containing one element for each
line of the captured output.</p>
<h3>Author(s)</h3>
<p>
Gregory R. Warnes <a href="mailto:warnes@bst.rochester.edu">warnes@bst.rochester.edu</a>
</p>
<h3>References</h3>
<p>
Functionality requested by Kevin Wright
<a href="mailto:kwright@eskimo.com">kwright@eskimo.com</a> in the R-devel newlist posting
<a href="https://www.stat.math.ethz.ch/pipermail/r-devel/2004-January/028483.html">https://www.stat.math.ethz.ch/pipermail/r-devel/2004-January/028483.html</a>
</p>
<h3>See Also</h3>
<p>
<code><a href="../../utils/html/capture.output.html">capture.output</a></code>, <code><a href="textplot.html">textplot</a></code>
</p>
<h3>Examples</h3>
<pre>
## Not run:
set.seed(12456)
x <- factor(sample( LETTERS[1:5], 50, replace=TRUE))
y <- rnorm(50, mean=as.numeric(x), sd=1)
par(mfrow=c(1,2))
boxplot(y~x, col="darkgreen")
sinkplot()
anova(lm(y~x))
sinkplot("plot",col="darkgreen")
## End(Not run)
</pre>
<hr><div align="center">[Package <em>gplots</em> version 2.3.2 <a href="00Index.html">Index]</a></div>
</body></html>