Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.A41.4.44.0207100835570.16708-100000@homer25.u.washington.edu>
Date: 2002-07-10T15:38:26Z
From: Thomas Lumley
Subject: plotting only text as a table
In-Reply-To: <20020710121844.46e7deb4.sholl@gmx.net>

On Wed, 10 Jul 2002, Stephan Holl wrote:

> Dear R-Gurus,
>
> I am preparing a multiple-plot-sheet with 2rows and 2 columns, but there
> are actually only 3 plots to plot.
> the 4. part of my sheet should contain a table with simple statistic
> values like n, mode, standard deviation....
>
> I cannot handle to plot the information in the plot. the summary()
> function prints it to the xtrem instead of the plot.
>

If you have some lines of text in variable foo you can get a reasonable
start on plotting it with

	plot.new()
	plot.window(xlim=c(0,1),ylim=c(0,1))
	text(0.5,0.5, paste(foo,collapse="\n"))

which will put it centered horizontally and vertically.  You will probably
then need to adjust things.

If you want the text to be the output of an R command and can't figure out
how to construct the text yourself you can capture it in a textConnection.
There is an example in help(textConnection).

	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._