[R] Plotting large texts into pdf file

Jacob, Michael J. Michael.Jacob at bruker-axs.de
Tue Sep 28 10:27:41 CEST 2004

Is there an easy way to include larger amounts of text in a plot?
I need to include a text report in a pdf file that is automtically
created by a R script.

I open a pdf device, then create several plots which are nicely output
each on a page in
the resulting pdf file, then I want to append page(s) that contain only

The best I came up with is the following:

# create a new page
# setup some dummy coordinate system
# read the report as whole file (vector of lines)
f <- readLines(filename)
# concatenate the first 50 lines into on string with lines separated by
\n newline
t <- paste(f[1:50], collapse="\n")
# output text
text(0, 5, t, pos=4, cex=0.8, xpd=NA)

The problem is that the text is always centered in some way (with pos =
4 vertically,
and I cant easily put it into several pages.

Is there an easier way to do this that I overlooked?

For automation reasons I would like to have R output the text directly
into the pdf.

Thanks in advance


Der Inhalt dieser E-Mail ist vertraulich und ausschliesslich fuer den bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte, dass jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail unzulaessig ist. Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail in Verbindung zu setzen.

More information about the R-help mailing list