I just ran package update on my Win2000 R-1.6.1 and it installed new versions of lattice and grid (0.6-7 and 0.7-3 respectively). Then I ran demo(lattice) and noticed that the last plot, which is supposed to illustrate math expression usage, fails in the sense that all expression are shown literally. For example the title of the plot reads " pi*sum(x, i=0, n)", the x-axis label is "sigma[i]", the subtitle reads frac(demonstrating, expressions), etc. This happed using windows device as well as postscrip device (on Win2000 and Linux platforms). I am almost sure that this worked before. Could anybody confirm this? Andy __________________________________ Andy Jaworski Engineering Systems Technology Center 3M Center, 518-1-01 St. Paul, MN 55144-1000 ----- E-mail: apjaworski at mmm.com Tel: (651) 733-6092 Fax: (651) 736-3122
New versions of lattice and grid
6 messages · apjaworski@mmm.com, Peter Dalgaard, Deepayan Sarkar +1 more
On Thursday 19 December 2002 01:35 pm, apjaworski at mmm.com wrote:
I just ran package update on my Win2000 R-1.6.1 and it installed new versions of lattice and grid (0.6-7 and 0.7-3 respectively). Then I ran demo(lattice) and noticed that the last plot, which is supposed to illustrate math expression usage, fails in the sense that all expression are shown literally. For example the title of the plot reads " pi*sum(x, i=0, n)", the x-axis label is "sigma[i]", the subtitle reads frac(demonstrating, expressions), etc. This happed using windows device as well as postscrip device (on Win2000 and Linux platforms). I am almost sure that this worked before. Could anybody confirm this?
The problem is definitely real. Fortunately I had a fairly recent (but not the
most recent) version of grid that didn't have this problem, and comparing the
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)
}
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.
Deepayan
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.
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... ??
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Hi
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.
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... ??
Not gone yet (and not for a couple of hours it would seem). This was a brain-dead bug fix of mine. I'm working on a better one. Once I have that and have checked that I will put up a grid_0.7-4 Paul
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
Hi grid_0.7-4 has been submitted to CRAN. Apologies for the stuff up. I may try to go on holiday now ... :) Paul technical note: I used is.expression() rather than is.language() because that is all that grid's C code checks for. Yes, this should be expanded to allow is.language() at some point. even more technical note: is.language() does not correspond to the C-level function isLanguage ...
Paul Murrell wrote:
Hi 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.
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... ??
Not gone yet (and not for a couple of hours it would seem). This was a brain-dead bug fix of mine. I'm working on a better one. Once I have that and have checked that I will put up a grid_0.7-4 Paul
Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz