[R] New versions of lattice and grid

Deepayan Sarkar deepayan at stat.wisc.edu
Fri Dec 20 00:52:27 CET 2002


On Thursday 19 December 2002 04:30 pm, Peter Dalgaard BSA wrote:
> Deepayan Sarkar <deepayan at stat.wisc.edu> writes:
> > two, the problem seems to be a small change in grid.text. The older
> > version seems to work:
> >
> > grid.text <- function(label, x=unit(0.5, "npc"), y=unit(0.5, "npc"),
> >                   just="centre", rot=0, check.overlap=FALSE,
> >                   default.units="npc", gp=gpar(), draw=TRUE, vp=NULL) {
> >   if (!is.unit(x))
> >     x <- unit(x, default.units)
> >   if (!is.unit(y))
> >     y <- unit(y, default.units)
> >   txt <- list(label=label, x=x, y=y, gp=gp,
> >               ## WAS label = as.character(label)
> >               just=just, rot=rot, check.overlap=check.overlap,
> >               vp=vp)
> >   cl <- "text"
> >   grid.grob(txt, cl, draw)
> > }
>
> ...for values of "WAS" meaning "Is currently", I presume.

Right.

> > I have no idea whether this might break anything else. If Paul is able to
> > look at this before he disappears for the holidays, great. Otherwise, we
> > will probably have to wait to get this fixed.
>
> It's pretty patently wrong and I think Paul will be gone until after
> the 1.6.2 release, so it would be unfortunate to wait. Perhaps we
> could program defensively using something like
>
>    if (!is.language(label)) label <- as.character(label)
>    txt <- list(label=label, x=x, y=y, gp=gp, ...etc...
>
> ??

That seems like a good idea. For what it's worth, both grid and lattice pass R 
CMD check, and the other changes don't look like they are related.

Deepayan




More information about the R-help mailing list