[R] Adding text to page margin with lattice graphics

From: Dennis Fisher <fisher_at_plessthan.com>
Date: Thu, 07 Apr 2011 09:18:53 -0700

R: 2.12.1


I am working with lattice graphics for the first time and I am confused by some aspects of controlling these graphics. The most pressing issue is the following:

I can print the graphics without problems with the command:

However, I would like to add margin text (this terminology might not apply in this setting). I am able to do so with the following command:

        print(MYFUNCTION(SOMEOBJECT, page=function(page) grid.text("SOMETEXT", x=0.5, y=0.01)))

Two issues:
1. The added text overlaps text in SOMEOBJECT. How do I reserve space at the margins of the page in which I can print the added text? (the equivalent of par(mar=c(1,1,1,1)))

2. I was able to construct the command with some assistance from a colleague. But, I remain at a loss to understand the syntax:

	i.e., page is a function of itself?

Any help in interpreting the function would be appreciated.


Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 07 Apr 2011 - 16:22:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 07 Apr 2011 - 20:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive