sinkplot.html 2.74 KB
<!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 &lt;- factor(sample( LETTERS[1:5], 50, replace=TRUE))
   y &lt;- 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>