[R] grid and ps device (bg-color)

mkondrin mkondrin at hppi.troitsk.ru
Tue May 3 16:28:08 CEST 2005


> grid.rect(width=2, height=2,
>           gp=gpar(fill=ps.options()$bg.color))
Yes, it works (more or less), but the best is to use
as postscript device leaves a 0.25-inch frame around the page.
BTW wouldn't you fix a bug with the determination of "strwidth" in the 
code like this:
The last command calculates the width of the first element of l, which 
is not the thing one would like to have. The best would be the 
calculation of maximum length of vector's elements (a simple for-cycle 
in unit.c). It also solves the problems with
where the desired answer should be the length of the longest string in l 
(in R-2.0.1 this returns the length of the l[[0]] too).
I have fixed it in my R installation but the patch is obvious.
Thank you.

More information about the R-help mailing list