sinkplot {gplots} | R Documentation |
Divert R's standard text output to a graphics device.
sinkplot(operation = c("start", "plot", "cancel"), ...)
operation |
See below |
... |
Plot arguments. (Ignored unless operation ="plot"). |
This function allows the printed output of R commands to be captured and displayed on a graphics device.
The capture process is started by calling
sinkplot("start")
. Now R commands can be executed and all
printed output (except errors) will be captured. When the desired
text has been captured sinkplot("plot")
can be called to
actually display the output. sinkplot("cancel")
can be used to
abort the output capture without plotting.
The current implementation does not allow sinkplot
to be nested.
Invisibly returns a character vector containing one element for each line of the captured output.
Gregory R. Warnes warnes@bst.rochester.edu
Functionality requested by Kevin Wright kwright@eskimo.com in the R-devel newlist posting https://www.stat.math.ethz.ch/pipermail/r-devel/2004-January/028483.html
## 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)